Page 1 of 1

How to remove/deal with unwanted ?_route_= in url from google index???

Posted: Wed Jan 29, 2020 8:25 pm
by david3217
I've updated our webshop (OC 1.5.6.) to a new version (V2.3.0.2).
Now when i click an indexed link on Google to the new webshop i get an url like this: ** removed by mod **

And actually, the bold part is the right URL. But it shows a page not found instead, because it somehow adds ?_route_= etc behind it. When i remove that part manually, the link works fine.

So how can i make it go right directly?
I have pretty much zero .htaccess mod_rewrite knowledge, i've already tried some things i could find online, but they didn't work.

This is how my .htaccess mod_rewrite part looks like:

Code: Select all

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ 

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 %{HTTPS} !on
RewriteCond %{THE_REQUEST} \ /index\.php\?_route_=?([^&\ ]*)
RewriteRule ^(.*)$ https://www.mijnsieradenshop.nl/$1 [R=301,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]

Re: How to remove/deal with unwanted ?_route_= in url from google index???

Posted: Wed Jan 29, 2020 10:10 pm
by wrick0
Isnt that added in your sitemap.xml which gets send to google?

Re: How to remove/deal with unwanted ?_route_= in url from google index???

Posted: Wed Jan 29, 2020 10:29 pm
by ADD Creative
This line looks wrong for a start.

Code: Select all

RewriteCond %{THE_REQUEST} \ /index\.php\?_route_=?([^&\ ]*)
Are you saying the search engine has indexed URLs with ?_route_= in or are your reditects adding ?_route_=?

Re: How to remove/deal with unwanted ?_route_= in url from google index???

Posted: Wed Jun 03, 2020 3:18 pm
by _rhensu
ADD Creative wrote:
Wed Jan 29, 2020 10:29 pm
This line looks wrong for a start.

Code: Select all

RewriteCond %{THE_REQUEST} \ /index\.php\?_route_=?([^&\ ]*)
Are you saying the search engine has indexed URLs with ?_route_= in or are your reditects adding ?_route_=?

I'm having the same problem and it occurs when I redirected some url's. Hoping for your help to fix this. Thanks!

Re: How to remove/deal with unwanted ?_route_= in url from google index???

Posted: Wed Jun 03, 2020 3:20 pm
by _rhensu
I'm having the same problem after I redirected some url's.
Hoping for someone's help to fix this. Thanks!

Re: How to remove/deal with unwanted ?_route_= in url from google index???

Posted: Wed Jun 03, 2020 8:09 pm
by ADD Creative
You will need to provide more information if anyone is going to be able to help you. OpenCart version and details of the problem. Contents of htaccess if the problem relates to redirects or rewrites.