2

I am trying to forward /index.php?route=common/home to the domain name itself. I have tried the code below which works but it breaks the login page. I think the issue is that they used the same url for /admin/index.php?route=common/home and it will not allow me to login to the admin center. I have been unable to figure out how to fix the below redirect to restrict from the admin folder.

Any help on this matter is greatly appreciated.

# Redirect index to domain
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://www.mysite.com? [R=301,L]
anubhava
  • 761,203
  • 64
  • 569
  • 643
James
  • 702
  • 2
  • 15
  • 39
  • http://stackoverflow.com/questions/10813809/remove-index-phproute-common-home-from-opencart – Jay Gilford Sep 12 '13 at 16:24
  • I was looking for a .htaccess fix not a php fix. If there is an update that effects the edited file you will have to edit it again. Thus the reason for .htaccess redirects. – James Sep 12 '13 at 16:39
  • I understand, but the above will remove the common/home entirely. Also, you could write a very simlpe vQmod to do this for you so new versions don't overwrite the code – Jay Gilford Sep 12 '13 at 16:46

1 Answers1

2

Try to replace your rule with this:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.php\?route=common/home[?\s] [NC]
RewriteRule ^ /? [R=301,L]
anubhava
  • 761,203
  • 64
  • 569
  • 643