kanaka kanaka - 1 month ago 7
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:

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


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

Answer

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