Magento Multi Domain Separate Robots.txt Files

If you have more than one domain running on one magento platform You may need to run separate robot.txt files. Just add these rewrite conditions into your .htaccess file

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

RewriteCond %{HTTP_HOST} siteone\.com$ 
RewriteRule ^robots\.txt$ /siteone.txt [L] 
 
RewriteCond %{HTTP_HOST} sitetwo\.com$ 
RewriteRule ^robots\.txt$ /sitetwo.txt [L]

############################################

Then just add your robot.txt information in those text files and your done! Test it though a online tester.

Leave a Reply

Your email address will not be published. Required fields are marked *