title: Redirecting robots.txt to a php page
body: <p>I have a system that handles multiple domains under one file structure and each domain would need different sitemap and robots.txt.</p>
  
  <p>For sitemap I have set up a redirect and I know it works well. I would like to confirm that same is possible with robots.txt?</p>
  
  <p>I have added a rewrite rule in .htaccess that redirects person to a php page. On this php page I find what domain user has and print out correct information with text header.</p>
  
  <p>Is this allowed?</p>
  
  <p>Extra info:</p>
  
  <p>I have a codeigniter application that is used by domainA and domainB. while domainA should see robots for domainA, domainB should see robots for domainB. And if i am to create robots.txt in the root of the site both domainA and domainB would have access to it, due to that I have created a separate php page to give out correct robots for domainA and B.</p>
  
  <p>In .htaccess i have a rewrite rule similar to: </p>
  
  <pre><code>RewriteRule   ^robots.txt$ func/getRobots/$1 [L]
  </code></pre>
  
  <hr>
  
  <p>After looking around I was able to identify that other people do it:
  <a href="http://www.aberdeencloud.com/docs/guides/how-use-different-robotstxt-development-and-live-environments" rel="nofollow noreferrer">http://www.aberdeencloud.com/docs/guides/how-use-different-robotstxt-development-and-live-environments</a></p>
  
  <p><a href="https://stackoverflow.com/questions/7930866/htaccess-and-robots-txt-rewrite-url-how-to">.htaccess and robots.txt rewrite url how to</a></p>
  
  <p><a href="https://webmasters.stackexchange.com/questions/61654/redirect-google-crawler-to-different-robots-txt-via-htaccess">https://webmasters.stackexchange.com/questions/61654/redirect-google-crawler-to-different-robots-txt-via-htaccess</a></p>
  
  <p>I just want to be sure that it wouldn't damage SEO side of the system.</p>