batfan
5/1/2014 - 7:22 PM

Default HTACCESS

Default HTACCESS

RewriteEngine On 

# strip out querystrings for bots
RewriteCond %{HTTP_USER_AGENT} Google [NC,OR]
RewriteCond %{HTTP_USER_AGENT} MSNBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Slurp [NC]
RewriteCond %{QUERY_STRING} .
RewriteRule ^(.*)$ /$1? [L,R=301]

# rewrite second level to third level
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .? http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# rewrite index.html to root
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html\ HTTP/
RewriteRule ^(.*)index\.html$ /$1 [R=301,L]

#Define friendly 404 page
ErrorDocument 404 /404.html

# disable directory browsing
Options All -Indexes

# serve alternate default index page if needed
# DirectoryIndex business.html


# secure htaccess file
<Files .htaccess>
 order allow,deny
 deny from all
</Files>