Question

Here's my situation:

I'm trying to redirect users with JavaScript disabled to a PHP generated page (instead of an AJAX generated page) on my Apache server.

I'm currently using:

<noscript> <meta http-equiv="refresh" content="0; url=http://mydomain/no_js.php"> </noscript>

Is there a way to redirect users BEFORE the page loads?

P.S.: If not then any way faster than the one I'm currently using?

Thanks in advance!

Was it helpful?

Solution

If you need to redirect, make the PHP version the default and redirect if javascript is enabled. I would avoid this though and not have a redirect at all and just display on the same page based on whether javascript is enabled/disabled. You can show the javascript items if enabled. I usually have a class name no-script in the body of the page and remove it if javascript is enabled, you can then use CSS to target what to display based on that one tag.

OTHER TIPS

Not sure if this is going to do what youre looking for but here goes:

  1. First, create a page that checks to see wether or not javascript is active
  2. Second, if javascript is active, redirect to the correct page
  3. If not, redirect to the page created for when its not active

that way the page that you have without js enabled never lads without js bwing enabled. not in the slightest. If you REALLY need scripts just holler...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top