Hello guyz, this post is regarding 301 Redirects with OpenCart 1.5 / 1.5.1 greater or Opencart 2.0 or greater.
Are you having a problem with your OpenCart SEO? Are you trying to add 301 Redirects?
Are you getting ?_route_= added to the end of your redirects and Error Not Found Message?
There are two ways to fix, that will work, it does however still change the target URL, you have to add an ?, yes a question mark!
Here’s an example of what you need to use for a 301 Redirect in OpenCart .htaccess file:
Redirect 301 /the-old-file.htm http://www.yourdomain.com/new-product-url?
or
Redirect 301 /the-old-file.htm http://www.yourdomain.com/new-product-url/?
just add below line in .htaccess file:
RewriteRule ^the-old-file.htm$ http://www.yourdomain.com/new-product-url [R=301,L]
©2021. All rights reserved. Terms of Use | Privacy Policy
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Very good written information. It will be supportive to anybody who uses it, as well as myself. Keep up the good work – looking forward to more posts.
Hot damn, lokonig pretty useful buddy.
Hi, I want to redirect my website to a new domain.
But nothing is happening even after uploading .htaccess file with this code at the root of my old domain.
Please tell me if I am doing something wrong.
Subpages have same urls as mentioned below.
Options +FollowSymLinks
RewriteEngine on
Redirect 301 / MyNewDomain
Redirect 301 /index.php MyNewDomain
Redirect 301 /event.php MyNewDomain/ events.html
Redirect 301 /book_online.php MyNewDomain/ online-booking.html
Redirect 301 /contact.php MyNewDomain/ contact-us.html
Thanks!
Hello Jeffy,
Your syntax is wrong for redirection pl find below:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !olddomain.com/$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
RewriteRule ^filename.php/(.*)$ http://www.newdomain.com/filename.php [R=301,L]
Pl note replace olddomain with your existing one and new domain with your new one and filename accordingly.
Good day! I just wish to give yyou a big thumbss up for your great info you have got riyht here on this post.
I will be returnkng to your website for more soon.
Yes! Finally someone writes about check this.