Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine On
rewriteCond %{REQUEST_FILENAME} !-f
rewriteCond %{REQUEST_FILENAME} !-d
rewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)/(.+)/?$ index.php?division=$1&page=$2
rewriteCond %{REQUEST_FILENAME} !-f
rewriteCond %{REQUEST_FILENAME} !-d
rewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)/?$ index.php?division=$1 [L]
Options +FollowSymLinks
RewriteEngine on
#
# Externally redirect to remove trailing slash unless request
# resolves to an existing directory (canonicalize the SEF URLs)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(([^/]+/)*[^/]+)/$ http://www.example.com/$1 [R=301,L]
#
# [i]Domain canonicalization redirect rule goes here (This example forces "www")[/i]
# Externally redirect non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
#
# Skip the following two internal rewrites to the index.php script if the request has already
# been rewritten to the index.php script, ends with slash or a filetype, contains more
# than two directory levels, or resolves to an existing file, directory, or link
RewriteCond $1 ^index\.php$ [OR]
RewriteCond $1 ^library/ [OR]
RewriteCond $1 !^([^/]+/)?[^/.]+$ [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule ^(.*)$ - [S=2]
#
# Internally rewrite URLs of the form "/dir/name" or "/name"
# to index.php script (Qualified by the skip rule above)
RewriteRule ^([^/]+)/([^/.]+)$ index.php?division=$1&page=$2 [L]
RewriteRule ^([^/.]+)$ index.php?division=$1 [L]