301 redirect not working for me

Hello!

I know I’m going to sound stupid, but no matter how many times I’ve thought about it… I can’t get this to work on Hestia, on other servers such as CWP, it works without problems for me.

I’m trying to do a 301 redirect like this:

RewriteEngine On
RewriteRule ^robots.txt$ /robots.php [L,R=301]

The problem is that it doesn’t pay attention, I enter robots.txt and it doesn’t redirect - What am I doing wrong?

PS: Don’t hit me, possibly I’m already dizzy… hahaha

That’s it, as I said, I was already dizzy… it turns out that the problem is that robots.txt existed, when changing the name, it already redirects hahaha

Nginx takes priority over Apache2 so if robots.txt exists it will always take robots.txt

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.