I have a magento site with 2 language stores. Each having their own dedicated url to a given item or resource be it a static page or a product page.
I am using the URL rules via the CMS to manage my SEF URLs for all resources.
The problem is the following scenario:
1. Site defaults to LANG #1.
2. When user switches from LANG#1 to LANG#2, switch happens with no issues - content switches to specific lang (http://www.sitename.com/?___store=lang)
3. But regardless of what lang store I am in, if I have enter a url from the other lang store into my current language store, I get a 404 error.
What I want the system checking the current store for the resource requested. If not found it should route to the next store and check for the resource in there. If found, store should switch to the lang store the item was found and url redirected.
What class should I extend in order to achieve this ( i am quite new to magento).
I went as far as inspecting if I can extend this class to do what I want: /app/code/core/Mage/Core/Model/Mysql4/Url/Rewrite.php
But not sure if I am in the right location for such requirements.
Any help will be appreciated!