All pastes #568786 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-06-15 19:40 UTC
rendered paste body
This is the new bit only:

Options +FollowSymLinks
AddHandler server-parsed .inc

RewriteEngine On

# Remove trailing slash and .shtml from .shtml files.
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_URI} ^(/.+)(/|\.shtml)$ [NC]
RewriteCond %{DOCUMENT_ROOT}%1.shtml -f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.+)(/|\.shtml)$ http://silentflame.com/$1 [R=301,L]

# Force www.
RewriteCond %{HTTP_HOST} !^silentflame\.com$ [NC]
RewriteRule ^(.*)$ http://silentflame.com/$1 [R=301,L]

# Rewrite /<page> to /<page>.shtml
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_URI} ^(/.*[^/])/?$
RewriteCond %{DOCUMENT_ROOT}%1.shtml -f
RewriteRule ^(.*[^/])/?$ /$1.shtml [QSA,L]