Page 1 of 1

htaccess 301 redirect

Posted: Sun Jan 17, 2021 6:04 pm
by Jeens
I want to make some .htaccess redirects but somewho it is not working.
I to do 2 things:

1.) Redirect from https://domain.com/index.php to https://domain.com

2.) Redirect from https://domain.com/index.php?route=product/manufacturer to https://domain.com/brands
https://domain.com/brands is an adress that works when put in manually.

I tried many things and variations of this, but it is not working:

Code: Select all

RewriteBase /
RewriteRule ^https://domain.com/index.php$ https://domain.com [R=301,L]
RewriteRule ^index.php?route=product/manufacturer$ https://domain.com/brands [R=301,L]
I run opencart 2.3.0.2

Can anyone help? Thanks!

Re: htaccess 301 redirect

Posted: Sun Jan 17, 2021 11:33 pm
by IP_CAM
Yep, Google can:
https://www.google.com/search?q=force+h ... 8&oe=utf-8
And don't forget, after changing anything, always clear out all of your
OC Cache Sections, before testing again.

Re: htaccess 301 redirect

Posted: Mon Jan 18, 2021 12:40 am
by Jeens
IP_CAM wrote:
Sun Jan 17, 2021 11:33 pm
Yep, Google can:
https://www.google.com/search?q=force+h ... 8&oe=utf-8
And don't forget, after changing anything, always clear out all of your
OC Cache Sections, before testing again.
HTTPS works fine I want to make a 301 redirect

Re: htaccess 301 redirect

Posted: Mon Jan 18, 2021 4:50 pm
by xxvirusxx
You have Redirects on your hosting Cpanel. You have tried?

Re: htaccess 301 redirect

Posted: Mon Jan 18, 2021 11:11 pm
by khnaz35
Here is the link with both ways to do it from Cpanel as well from .htaccess
Have a look.

https://tribulant.com/docs/hosting-doma ... r-non-www/