Forum Moderators: phranque
errordocument 404 /error.php
errordocument 410 /error.php
Options -Indexes +FollowSymLinks
RewriteEngine on
RewriteRule \.htaccess - [F]
RewriteCond %{THE_REQUEST} \?
RewriteRule .? http://www.example.com%{REQUEST_URI}? [R=301,L]
RewriteCond %{THE_REQUEST} /([a-z/-]+)\.
RewriteRule . http://www.example.com/%1 [R=301,L]
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule .? http://www.example.com%{REQUEST_URI} [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /?http:// [NC]
RewriteCond %{THE_REQUEST} !^(GET¦HEAD¦POST¦OPTIONS¦PROPFIND¦TRACE)\ /?http://([^.]+\.)?example\.com/
RewriteRule .? - [G]
RewriteRule ^([a-z/-]+)?$ /script.php?url=$1 [L]
RewriteCond %{HTTP_USER_AGENT} ^User-Agent-Blocking [OR]
RewriteCond %{HTTP_USER_AGENT} Robot¦abot [NC]
RewriteRule .? - [G]
Just sort of a 'standard set' of rules I usually use to start new files.
Justin
Added: Some sets can be combined and/or edited, just wanted to give some ideas that might be important to site structure and function.