A
A
Andrew2020-11-26 17:45:13
htaccess
Andrew, 2020-11-26 17:45:13

How to replace the robots.txt file with robots.php in .htaccess?

There is an intricate system, once someone made two domains that lead to one folder on the hosting.
Depending on the domain, you need to give different robots.txt.
How to replace the robots.txt file with robots.php in .htaccess? No 301 redirect and no url change.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-11-26
@rabamaster

Eh, sorry, don't specify 301, what's the problem then?

RewriteEngine On
RewriteBase /
RewriteRule ^robots.txt$ /robots.php [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question