Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

What rewrite rule will redirect all links from a subdirectory to the same on a subdomain? In Magento
 
Danowah
Jr. Member
 
Total Posts:  6
Joined:  2011-09-19
Brisbane
 

I’m having redirection issues with changing my Magento multi-site of 5 stores over to a subdomain from a subdirectory. I’ve got the store working on the subdomain at http://ag.levanta.com.au but all indexed pages in Google that were previously on the subdirectory URL (at http://www.levanta.com.au/commercial/agriculture of the same store are now just redirecting to the root subdomain at it’s base (with no link to the actual product or category url).

My .htaccess file is in the root directory outside of Magento and all stores. An overview looks like:

Home page - http://www.example.com.au (where htaccess is)

Store 1 - http://www.example.com.au/commercial/store1
Store 2 - http://www.example.com.au/commercial/store2
Store 3 - http://www.example.com.au/commercial/store3
Store 4 - http://www.example.com.au/commercial/store4

Store 5 - http://store5.example.com.au (where store 5 has been moved to)
So all currently indexed links go to http://store5.example.com.au/ only. They do not go to their relevant long URL as indexed.

I have tried a Rewrite rule in both the root htaccess and inside the old directory for Store5 at /commercial/store5 but neither work.

This is what I have in the old sub directory:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^levantan.com.au/commercial/agriculture1$
RewriteRule ^(.*)$ http://ag.levanta.com.au/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.levantan.com.au/commercial/agriculture$
RewriteRule ^(.*)$ http://ag.levanta.com.au/$1 [R=301,L]
</IfModule>

Is there something I am missing here? I can’t figure out whether it’s a Magento issue or merely wrong syntax or placement of the rewriterule.

I’ve also tried adding a rewrite rule inside of the admin and it doesn’t have an effect.

Any help would be greatly appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top