Redirects store view urls (e.g. from search engine result page) to the correct store view, otherwise standard 404 magento error
When you are using Magento Store Views as languages for your Magento shop you probably experiencing 404 error pages when you try to open an URL from another store view and you have disabled storecodes in URLs. By default, Magento routes the request to a 404 error page in the current active store view. This is a major problem when your localized store view URLs are indexed by search engines or other systems.
This small extension simply redirects Magento request URLs (e.g. from search engine result page) to the correct (or best matching) store view and bypasses the standard 404 magento error page.
Search is done for column request_path
in table core_url_rewrite
. The module does not check admin requests, only frontend requests.
When only one store view is found for the request URL, this store view is used for redirection. However, when two or more store views are found, the best matching store view for the request url is given through the sort order in Backend > Configuration > Manage Stores.
This module also works when you have multiple Magento websites. It only performs redirections to the store views that are assigned to the current website.
Feel free to make a pull request when you have ideas for improving.
modman remove JH_Storeredirect
jh_storeredirect