Jump to content

Redirect issue


phpknight

Recommended Posts

I don't normally use redirects, but I have a page that redirects users who land at certain pages after three seconds.  It works just fine.  However, if I click the reload button on the browser before the redirect occurs (like after a second or two) then the redirect no longer happens at all.  Why is this the case?

Link to comment
https://forums.phpfreaks.com/topic/82963-redirect-issue/
Share on other sites

Either will work if you have your script set-up the right way. I would use PHP; just to avoid the slight chance that end user does not have js or metas enabled on their browser. Plus that way you can validate the PHP global variable "$_SERVER"; too check for specific pages that you want to be redirect to/from.

Link to comment
https://forums.phpfreaks.com/topic/82963-redirect-issue/#findComment-422307
Share on other sites

I don't know how your using your code - but if you use the below meta; then it should work fine.

 

<meta http-equiv="refresh" content="3;url=http://www.google.com">

 

You can reload the page as many times as you want; if you allow the page to not be reloaded for 3 seconds; the meta will redirect.

Link to comment
https://forums.phpfreaks.com/topic/82963-redirect-issue/#findComment-422593
Share on other sites

then your page will redirect to the meta's url; even if you reload it. maybe your browser has meta tags turned off. that is the only reason I could see for your meta not redirecting. it probably has to do with how your validating the landing page. post your full code and I will take a look at it.

Link to comment
https://forums.phpfreaks.com/topic/82963-redirect-issue/#findComment-422964
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.