301 Redirect from deleted language to new language


I have a problem with 301 redirect.

A customer had his old shop in Greek language, but the Language sign was GR instead of EL wich is the default. (EN is for English)

So now we updated the store to 305 version and Google has links with the old string query ?sl=GR wich is causing a 404 error.

If I try to 301 redirect the normal way it wont work. It still adds the ?sl=GR at the end of the new page/gategory/product link. So again a 404 error.

I need either to have ?sl=EL or absolute nothing would be ideal.

Any ideas?


  1. The store is not in root but under /eshop folder
  2. I tried some stuff like RewriteCond %{QUERY_STRING} ^sl=GR$ [NC]

    but the best case scenario was redirecting to the index.php


Hey fotis,

Your message is not entirely clear to me. Could you simply show me the urls you want to redirect… from, and to?

Hi Flow


I have [url=“http://www.mkaywear.com/eshop/shop-13/for-guys/category-321/?sl=GR”]http://www.mkaywear.com/eshop/shop-13/for-guys/category-321/?sl=GR[/url]

which I want ot redirect to [url=“http://www.mkaywear.com/eshop/chart.html”]http://www.mkaywear.com/eshop/chart.html[/url]

It wont redirect it. I get [url=“http://www.mkaywear.com/eshop/chart.html”]http://www.mkaywear.com/eshop/chart.html[/url][url=“http://www.mkaywear.com/eshop/shop-13/for-guys/category-321/?sl=GR”]/?sl=GR[/url] which is 404!

If this was [url=“http://www.mkaywear.com/eshop/chart.html?sl=EL”]http://www.mkaywear.com/eshop/chart.html?sl=EL[/url] it would work.


Catch 22…you could apply a global query string re-formatting using htaccess, but this will also break CS-Cart's query strings (index.php?dispatch=…). A more specific one would be to strip ?sl=GR from the URL, which you can do so by adding this to your .htaccess, which should be added BEFORE you add any further rules:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^sl=GR$
RewriteRule (.*) $1? [R=permanent]

This would therefore allow you to create simple redirects, such as:

redirect 301 /your-old-page.html http://www.domain.co…r-new-page.html

Without then having to worry about ?sl=GR being added to the end of the URL causing a 404 as it has already been stripped out before the redirect is processed.

Also, why not put the language as /en/ in the url? That's much cleaner and you'll be able to geotarget each language as an individual website in google webmaster.



]Well it worked fine.


[left]I did tried this but the catch was in the order! I should put this on the very beggining , which I didnt!!![/left]

[left]Mil thanks man![/left]

[left]language in the url is a good aproach but not possible for now, as I need to redirect a mass of links…[/left]