At the root of the site file. .htaccess :
RewriteEngine On RewriteCond %{REQUEST_URI} ^.*.txt$ [NC] RewriteRule .* - [L,R=404] Here, the 404 error is returned to any request from the txt file. You need to change the regular expression:
^.*.txt$ So that it matches all .txt files except robots.txt .