Forum Moderators: phranque
[edited by: jdMorgan at 2:51 pm (utc) on Feb 9, 2010]
[edit reason] example.com [/edit]
^page[0-9]{1,2}\.html$ (assuming always a single or double digit number).
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
#
RewriteRule ^index\.html$ http://www.example.com/ [R,L] - This is the one that does not work
RewriteRule ^aboutus\.html$ http://www.example.com/about-my-company/ [R,L]
RewriteRule ^testimonials\.html$ http://www.example.com/ [R,L]
RewriteRule ^portfolio\.html$ http://www.example.com/company-portfolio/ [R,L]
RewriteRule ^services\.html$ http://www.example.com/what-we-offer/ [R,L]
RewriteRule ^contact\.html$ http://www.example.com/contact-us/ [R,L]
[edited by: jdMorgan at 2:53 pm (utc) on Feb 9, 2010]
[edit reason] Use example.com only. [/edit]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.html[^\ ]*\ HTTP/
RewriteRule ^index\.html$ http://www.example.com/ [R=301,L]
RewriteEngine On
#
RewriteRule ^index\.html?$ http://www.example.com/ [R=301,NC,L]
RewriteRule ^page1\.html$ http://www.example.com/page1/ [R=301,NC,L]
RewriteRule ^page2\.html$ http://www.example.com/page2/ [R=301,NC,L]
RewriteRule ^page3\.html$ http://www.example.com/page3/ [R=301,NC,L]
RewriteRule ^page4\.html$ http://www.example.com/ [R=301,NC,L]
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteRule ^(([^/]+/)*)index\.php$ http://www.example.com/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
#
RewriteCond %{REQUEST_URI} !^/(index\.php|robots\.txt|sitemap\.xml)$
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|css|js|png|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]