Forum Moderators: phranque
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# Add slashes to the end of everything, if not present:
RewriteCond %{REQUEST_URI} !\.[^./]+$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://localhost/$1/ [R=301,L]
# Redirect about/ and about/X to about.php?get=X:
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^page/$ page.php
RewriteRule ^page/([A-Za-z\+\-]+)/?$ page.php?x=$1
</IfModule> <IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# Add slashes to the end of everything, if not present:
RewriteCond %{REQUEST_URI} !\.[^./]+$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://localhost/cms/$1/ [R=301,L]
# Redirect about/ and about/X to about.php?get=X:
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^about/$ about.php
RewriteRule ^about/([A-Za-z\+\-]+)/?$ about.php?x=$1
</IfModule> RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^about/([A-Za-z\+\-]+)/?$ about.php?x=$1
RewriteEngine on
RewriteBase /
# Add slashes to the end of everything, if not present:
RewriteCond %{REQUEST_URI} !\.[^./]+$
RewriteCond %{REQUEST_URI} !([^/.]+)/$
RewriteRule ^(.*)$ http://localhost/$1/ [R=301,L]
# Redirect about/ and about/X to about.php?get=X:
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^page/$ page.php [L]
RewriteRule ^page/([a-z0-9+-]+)/?$ page.php?x=$1 [NC] [L]
RewriteRule ^(about)|(contact)|(blog)/$ $1.php [NC] [L] should be [NC,L] +)/?$ should be +)/$ or +)$ not using a pattern where both are allowed. RewriteRule ^(about)|(contact)|(blog)/$ $1.php RewriteRule ^(about|contact|blog)/$ $1.php Also you mention duplicate content, but by adding the trailing slash automatically like i am doing, doesn't that stop the chances of duplicate content?
example.com/folder/ -- the URL for a folder. example.com/page -- the extensionless URL for a page. example.com/object.ext -- the URL for a stylesheet or for an image.
RewriteEngine on
RewriteBase /
## Add slashes to the end of everything, if not present: ##
RewriteCond %{REQUEST_URI} !\.[^./]+$
RewriteCond %{REQUEST_URI} !([^/.]+)/$
RewriteRule ^(.*)$ http://localhost/$1/ [R=301,L]
## Redirect about/ and about/X to about.php?get=X: ##
##RewriteCond %{SCRIPT_FILENAME} !-d ## remove slow checks ##
##RewriteCond %{SCRIPT_FILENAME} !-f ## remove slow checks ##
RewriteRule ^(about|contact|blog|page)/$ $1.php [L]
RewriteRule ^(about|contact|blog|page)/([a-z0-9+-]+)/$ $1.php?x=$2 [NC,L]
## Add slashes to the end of everything, if not present: ##
RewriteCond %{REQUEST_URI} !\.[^./]+$
[code]RewriteCond %{REQUEST_URI} !([^/.]+)/$
RewriteRule ^(.*)$ http://localhost/$1/ [R=301,L]
RewriteCond %{REQUEST_URI} !\.[^./]+$ RewriteCond %{REQUEST_URI} !([^/.]+)/$ RewriteCond %{REQUEST_URI} !([^/.]+)/$
RewriteRule ^(.*)$ {stuff that turns into a link when I Preview}/$1/ [R=301,L]
RewriteCond %{REQUEST_URI} !\.[^./]+$
is where, doesn't start with a '.' and doesnt match a '/'
RewriteCond %{REQUEST_URI} !([^/.]+)/$
doesnt match a '/' or any charachter and ends with '/'