I would like this:
<NOSCRIPT>
<META HTTP-EQUIV="refresh" CONTENT="1; URL=js/nonJs.htm">
</NOSCRIPT>
to be the first thing the server sends to the browser (before all other info)
were should I place the code?
thanks
I need to use this script to block bots (the site is on a dedicated server but so much traffic comes from bots that it makes the site unusable )
after implementing this code on my site it is almost twice as fast!!! but still quite slow (and the loss of visitors is minimal – who does not have js enabled…) but they way it is now is that the site loads and then the no js script kicks in – but I would prefer the side not loading before the js script has been verified (maybe this is possible on the server side???)
You can keep that piece of HTML in your head section as it doesn’t really matter what order it is sent.
If the bot is half decent it will be able to run JS, further more bots will probably ignore the refresh command andway.
If all your traffic is coming from a particular bot you can record its user agent string and just block it altogether using something server side or htacces if your on Apache: http://www.thesitewizard.com/apache/block-bots-with-htaccess.shtml
If its a large bot like Google or Bing, then they will follow the rules and you can create a robots.txt: http://www.robotstxt.org/robotstxt.html – This will allow robots to only access pages you want them to.