I have developed an e-commerce site using Magento 1.9.

And it is working very fine. But the problem is when the site was live google crawled all the pages and products with the store name such as ...english5/allopathy..html etc.

Recently I removed the store name from the URL and now it's showing not found from the webmaster tool. If it is few links I might be able to redirect it using .htaccess but there are more than 6000 URLs being crawled. Now users coming from google clicking on the links are redirected to the home page by default since the URL does not contain the store name. Can anyone guide how to solve this issue? Thank you in advance.


Depending on your webserver here are two options:

For an Apache webserver:

Place this piece of code in your .htaccess located in your stores webroot:

RewriteEngine on
RewriteRule ^english5/(.*)$ /$1 [R=301,L]

This will redirect http://www.domain.com/english5/allopathy.html to http://www.domain.com/allopathy.html.

For an nginx webserver a rule like this in your hosts config should probably due the same:

rewrite ^/english5/(.*)$ /$1 permanent;

There are many references on this topic in the general https://stackoverflow.com.

  • Thank you so much for your reply. I have added the piece of code in my .htaccess file but this does not seem to do the job. Does this need time to reflect on the server and website?
    – Praveen
    Mar 1 '18 at 4:44
  • @Praveen, no, this changes is supposed to take immediate affect on your store when placed in the .htaccess file in your webroot (i.e. the path where your app, skin and media folders are located). If it does not affect your store this might mean, that your webspace is not configured to respect the .htaccess file - you might want to check this with your hosting provider. Mar 2 '18 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.