OpenCart 301 Redirect Not Working ?_route_=

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!

First:

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/?

Second:

just add below line in .htaccess file:
RewriteRule ^the-old-file.htm$ http://www.yourdomain.com/new-product-url [R=301,L]

Next Post

non-www to www redirect in web.config

6 comments

  1. 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.

    1. Kalin says:

      Hot damn, lokonig pretty useful buddy.

  2. Jeffy says:

    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!

    1. Webpioneer says:

      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.

  3. macros says:

    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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top