Forum Moderators: phranque
[edited by: jdMorgan at 2:59 pm (utc) on Oct 7, 2010]
[edit reason] De-linked URLs for readability. [/edit]
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
#
# Externally redirect client requests for old dynamic URLs to equivalent new static URLs
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /content\.php\?page=([^&\ ]+)\ HTTP/
RewriteRule ^content\.php$ http://test.localhost/page/%1? [R=301,L]
#
# Externally redirect requests for /index to "/"
RewriteRule ^index$ http://test.localhost/ [R=301,L]
#
# Externally redirect non-canonical hostname requests to canonical hostname
# (update this when you move the site to a real domain)
RewriteCond %{HTTP_HOST} !^(test\.localhost)?$
RewriteRule ^(.*)$ http://test.localhost/$1 [R=301,L]
#
# Internally rewrite search engine friendly static home page URL to dynamic filepath and query
RewriteRule ^$ content.php?page=index [L]
#
# Internally rewrite other search engine friendly static URLs to dynamic filepath and query
RewriteRule ^page/([^/]+)/?$ content.php?page=$1 [L]