kanaka kanaka - 1 year ago 70
HTML Question

How to do a http-equiv redirect that preserves query_string and fragment_id

In Javascript I can redirect and preserve the query string and fragment ID like this:

window.location = "NEW_LOCATION" + window.location.search + window.location.hash;

For sites without Javascript you can use the http-equiv meta header. But this drops the query string and fragment ID:

<meta http-equiv="Refresh" content="300; url=NEW_LOCATION" />

Is there a way to do the equivalent using http-equiv="refresh" that preserves the query string and fragment ID?

Answer Source

Not without a server-side scripting language which puts the proper url in the HTML tag (or sends a Refresh header directly).