Magento News

 

Complex Apache redirect

I have a magento installation with 2 websites
mydomain.net and mydomain.com
Both stores have different category structure but the page products are the same and I can see all products page using the root without using the category structure.

Example of this:
www.mydomain.net/product1.html is the same than
www.mydomain.net/category/product1.html

But in mydomain.com the category tree might be different.
Example:
www.mydomain.com/product1.html is the same than
www.mydomain.com/category/subcategory/product1.html

I need to create a redirect from all my pages in the .net to the .com, but pointing to the shortest URL, meaning after the first /.

Examples of how it should work:

**www.mydomain.net to www.mydomain.com

www.mydomain.net/product1.html to www.mydomain.com/product1.html

www.mydomain.net/category/product2.html to www.mydomain.com/product2.html

www.mydomain.net/category/subcategory/sub/sub/sub/product3.html just to www.mydomain.com/product3.html**

How can I do this for my magento installation? I suppose its with appache redirects in the index.php file ?

Could you please provide me with some kind of code or configuration to do this, because I dont have any experience with Apache.

Complex Apache redirect

Possibly Related Posts:


 

Leave a Reply