问题描述:

I want to make changes to my htaccess file so that if someone puts in mydomain.com/index.php or mydomain.com/index.php?route=common/home it redirects them to mydomain.com. I have already have my domain redirecting from www.mydoamin.com to mydomain.com. Below is what I have in my file to do this. Now I don't understand this at all but I got it of a thread here and it works for me.

RewriteCond %{HTTP_HOST} !^vineyardwine\.co.uk [NC]

RewriteRule (.*) http://vineyardwine.co.uk/$1 [R=301,L]

I got the following off different threads but they don't seem to be doing anything, any help/constructive critique will be greatly appreciated.

RewriteBase /

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]

RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]

RewriteRule ^download/(.*) /index.php?route=error/not_found [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)

RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /index.php?/$1 [L]

网友答案:

Add this right below RewriteBase /:

RewriteCond %{THE_REQUEST} \ /+index\.php(\ |\?route=common/home|$) 
RewriteRule ^ /? [L,R=301]
相关阅读:
Top