On a Magento based ecommerce site I am trying to remove index.php from URLs as well as 301 redirect non-www to www.
Default URL: www.example.com/index.php/super-cool-product.html
Desired Product URL: www.example.com/super-cool-product.html
Also 301 redirecting non-www to www:
example.com/super-cool-product.html
to:
www.example.com/super-cool-product.html
As well as:
www.example.com/index.html
to:
www.example.com
This is what I currently have:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.rejuvahealth.com/$1 [R=301,NC,L]
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ http://www.rejuvahealth.com/$1 [R=301,NC,L]