Forum Moderators: phranque
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ index.php?p=$1&id=$2
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ index.php?p=$1&cat=$2
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ index.php?p=$1&sort=$2 [L]
RewriteEngine On
Options -Indexes
Options +FollowSymLinks
RewriteRule ^admin/$ /admin/index.php
RewriteRule ^(.*)/$ index.php?p=$1
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ index.php?p=$1&id=$2
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ index.php?p=$1&cat=$2
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ index.php?p=$1&sort=$2 [L]
example.com/s34 for section numbers, example.com/p3456 for pages, example.com/r3456 for reviews, example.com/n567 for news, and so on.
RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)/$ /$1/$2/ [R=301]
RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)$ index.php?p=$1&cat=$2 [L]
RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)/$ /$1/$2/ [R=301]
RewriteRule ^http://www.myserver.com/([a-zA-Z]+)/([a-zA-Z]+)$ /$1/$2/ [L]
Options +FollowSymLinks -Indexes
RewriteEngine on
#
# Externally redirect to add missing trailing slash to all requested extensionless
# URL-paths of the form /<letters> or /<letters>/<letters-and-or-numbers>
RewriteRule ^([a-z]+(/[a-z0-9]+)?)$ http://www.example.com/$1/ [NC,R=301,L]
#
# Externally redirect requests for non-canonical hostname to canonical hostname
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
#
# Internally rewrite requested extensionless page/sort URL-paths of the
# form /<letters>/<specific-sort-type>/ to the script filepath
RewriteRule ^([a-z]+)/(price|size|color|ascending|descending)/$ index.php?p=$1&sort=$2 [NC,L]
#
# Else internally rewrite requested extensionless page/category URL-paths
# of the form /<letters>/<letters>/ to the script filepath
RewriteRule ^([a-z]+)/([a-z]+)/$ index.php?p=$1&cat=$2 [NC,L]
#
# Internally rewrite requested extensionless page/id URL-paths
# of the form /<letters>/<numbers>/ to the script filepath
RewriteRule ^([a-z]+)/([0-9]+)/$ index.php?p=$1&id=$2 [NC,L]
#
# Internally rewrite requests for admin page URL-path to script filepath
RewriteRule ^admin/$ /admin/index.php [L]
#
# Else rewrite all remaining requested single-directory-level extensionless
# URL-paths of the form /<letters-and-or-numbers>/ to the script filepath
RewriteRule ^([a-z0-9]+)/$ index.php?p=$1 [NC,L]
I don't want to add or remove it, just make sure that users see content whichever way the try to access a page with.