Return to Snippet

Revision: 34665
at October 5, 2011 03:32 by BFTrick


Updated Code
<FilesMatch ".(ini)$">
Order allow,deny
deny from all
</FilesMatch>

Options +FollowSymlinks
Options All -Indexes
RewriteEngine on


#########################################
# rewrite all non www urls to www urls
#########################################
RewriteCond %{HTTP_HOST} !^www.sitename.com$
RewriteRule ^(.*)$ http://www.sitename.com/$1 [R=301,L]


#########################################
# add trailing slashes to directories
#########################################
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://sitename.com/$1/ [L,R=301]


#########################################
# 404 page
#########################################
ErrorDocument 404 /404.php


#########################################
# 301 Redirects
#########################################
redirect 301 /old/old.htm http://www.sitename.com/new/new.htm


#########################################
# secure pages
#########################################
#RewriteCond %{REQUEST_URI} /cart.php [OR]
#RewriteCond %{SERVER_PORT} 80 
#RewriteRule ^(.*)$ https://www.sitename.com/$1 [R,L]


#########################################
# unsecure pages
#########################################
#RewriteCond %{REQUEST_URI} /products [OR]
#RewriteCond %{SERVER_PORT} 443 
#RewriteRule ^(.*)$ http://www.sitename.com/$1 [R,L]

Revision: 34664
at September 30, 2011 02:06 by BFTrick


Updated Code
<FilesMatch ".(ini)$">
Order allow,deny
deny from all
</FilesMatch>

Options +FollowSymlinks
Options All -Indexes
RewriteEngine on


#########################################
# rewrite all non www urls to www urls
#########################################
RewriteCond %{HTTP_HOST} !^www.sitename.com$
RewriteRule ^(.*)$ http://www.sitename.com/$1 [R=301,L]


#########################################
# add trailing slashes to directories
#########################################
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301]


#########################################
# 404 page
#########################################
ErrorDocument 404 /404.php


#########################################
# secure pages
#########################################
#RewriteCond %{REQUEST_URI} /cart.php [OR]
#RewriteCond %{SERVER_PORT} 80 
#RewriteRule ^(.*)$ https://www.sitename.com/$1 [R,L]


#########################################
# unsecure pages
#########################################
#RewriteCond %{REQUEST_URI} /products [OR]
#RewriteCond %{SERVER_PORT} 443 
#RewriteRule ^(.*)$ http://www.sitename.com/$1 [R,L]

Revision: 34663
at September 30, 2011 02:05 by BFTrick


Updated Code
<FilesMatch ".(ini)$">
Order allow,deny
deny from all
</FilesMatch>

Options +FollowSymlinks
Options All -Indexes
RewriteEngine on


#########################################
# rewrite all non www urls to www urls
#########################################
RewriteCond %{HTTP_HOST} !^www.sitename.com$
RewriteRule ^(.*)$ http://www.sitename.com/$1 [R=301,L]


#########################################
# add trailing slashes to directories
#########################################
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301]


#########################################
# 404 page
#########################################
#ErrorDocument 404 /404.php


#########################################
# secure pages
#########################################
#RewriteCond %{REQUEST_URI} /cart.php [OR]
#RewriteCond %{REQUEST_URI} /Admin/ [OR]
#RewriteCond %{REQUEST_URI} /confirm.php [OR]
#RewriteCond %{SERVER_PORT} 80 
#RewriteRule ^(.*)$ https://www.sitename.com/$1 [R,L]


#########################################
# unsecure pages
#########################################
#RewriteCond %{REQUEST_URI} /products [OR]
#RewriteCond %{REQUEST_URI} /search.php [OR]
#RewriteCond %{REQUEST_URI} /sitemap.php [OR]
#RewriteCond %{SERVER_PORT} 443 
#RewriteRule ^(.*)$ http://www.sitename.com/$1 [R,L]

Revision: 34662
at October 27, 2010 00:10 by BFTrick


Updated Code
<FilesMatch ".(ini)$">
Order allow,deny
deny from all
</FilesMatch>

Options +FollowSymlinks
Options All -Indexes
RewriteEngine on


#########################################
# rewrite all non www urls to www urls
#########################################
#RewriteCond %{HTTP_HOST} !^www.sitename.com$
#RewriteRule ^(.*)$ http://www.sitename.com/$1 [R=301,L]


#########################################
# 404 page
#########################################
#ErrorDocument 404 /404.php


#########################################
# secure pages
#########################################
#RewriteCond %{REQUEST_URI} /cart.php [OR]
#RewriteCond %{REQUEST_URI} /Admin/ [OR]
#RewriteCond %{REQUEST_URI} /confirm.php [OR]
#RewriteCond %{SERVER_PORT} 80 
#RewriteRule ^(.*)$ https://www.sitename.com/$1 [R,L]


#########################################
# unsecure pages
#########################################
#RewriteCond %{REQUEST_URI} /products [OR]
#RewriteCond %{REQUEST_URI} /search.php [OR]
#RewriteCond %{REQUEST_URI} /sitemap.php [OR]
#RewriteCond %{SERVER_PORT} 443 
#RewriteRule ^(.*)$ http://www.sitename.com/$1 [R,L]

Revision: 34661
at October 27, 2010 00:08 by BFTrick


Initial Code
<FilesMatch ".(ini)$">
Order allow,deny
deny from all
</FilesMatch>

Options +FollowSymlinks
Options All -Indexes
RewriteEngine on


#########################################
# rewrite all non www urls to www urls
#########################################
#RewriteCond %{HTTP_HOST} !^www.sitename.com$
#RewriteRule ^(.*)$ http://www.sitename.com/$1 [R=301,L]


#########################################
# 404 page
#########################################
#ErrorDocument 404 /404.php


#########################################
# secure pages
#########################################
#RewriteCond %{REQUEST_URI} /cart.php [OR]
#RewriteCond %{REQUEST_URI} /Admin/ [OR]
#RewriteCond %{REQUEST_URI} /confirm.php [OR]
#RewriteCond %{REQUEST_URI} /international.php [OR]
#RewriteCond %{REQUEST_URI} /signup.php
#RewriteCond %{SERVER_PORT} 80 
#RewriteRule ^(.*)$ https://www.sitename.com/$1 [R,L]


#########################################
# unsecure pages
#########################################
#RewriteCond %{REQUEST_URI} /products [OR]
#RewriteCond %{REQUEST_URI} /search.php [OR]
#RewriteCond %{REQUEST_URI} /sitemap.php [OR]
#RewriteCond %{REQUEST_URI} /whatsnew.php
#RewriteCond %{SERVER_PORT} 443 
#RewriteRule ^(.*)$ http://www.sitename.com/$1 [R,L]

Initial URL


Initial Description
A default HTAccess file. Uncomment any lines that you want to use.

http://enarion.net/web/htaccess/trailing-slash/

Initial Title
Default HTAccess

Initial Tags
htaccess

Initial Language
Apache