user1263981
user1263981

Reputation: 3147

Meta tag doesn't work on refreshing page (F5)

I am using meta tag to redirect user to our career page after 5 seconds in asp classic page.

Page works fine the first time you visit but if i refresh this page or press F5 then system won't redirect me to the specific page (IE).

I have used a meta tage on following two formats but still seeing same results.

<meta http-equiv="refresh" content="5; URL=/careers/opportunities.asp" />

<meta http-equiv="refresh" content="5; URL=http://www.mycompany.com/careers/opportunities.asp" />

Both meta tags work fine on firefox.

Any fix for IE?

Upvotes: 0

Views: 786

Answers (1)

Control Freak
Control Freak

Reputation: 13233

Add this to the page also and it should do the trick.

 <script language="javascript" type="text/javascript">
   x = setTimeout("window.location='whereever.asp';",5000);  //5000 = 5 seconds
 </script>

This is Javascript, which means it runs on the client, and gives a 5 second pause.

If you want to do a hard redirect on the server without giving any kind of notice like You are being redirected, then you can use Response.Redirect

 Response.Redirect("/whereever.asp")

Or

Response.Status = "301 Moved Permanently"
Response.AddHeader "Location","/whereever.asp"

Since Response.Redirect gives another Status code to the search engine, if SEO is not required, then any of these methods would work.

Upvotes: 1

Related Questions