In the following scenario, example.com is my homepage.
I need to:
redirect
www
tonon-www
redirect
index.html
to homepageredirect
example.com/store
toexample.com
This is my htaccess code
# Switch rewrite engine on
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Do index.html to root redirect
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ http://%{HTTP_HOST}/$1 [R=301,L]
RedirectMatch 301 ^/store/$ http://example.com
This seems to work except it only redirects example.com/store/
(with forward slash after store) to the homepage. It does not redirect example.com/store
(without forward slash)
Any ideas how I can fix this?