Home page link
Posted: Sun 20 Mar 2011 9:25 am
When I write web pages I use .htaccess to get around any problems with DNS and reluctant servers. The code looks like this;
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?somesite.com/.*$ [NC]
RewriteRule \.(gif|jpg|png)$ http://www.somesite.com/nasty.ginasty.gif [R,L]
All you need to do is substitute your correct URL in the bottom line and the preceeding lines and the code will convert any combination of upper and lower case and even some spelling mistakes to your correct URL.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?somesite.com/.*$ [NC]
RewriteRule \.(gif|jpg|png)$ http://www.somesite.com/nasty.ginasty.gif [R,L]
All you need to do is substitute your correct URL in the bottom line and the preceeding lines and the code will convert any combination of upper and lower case and even some spelling mistakes to your correct URL.