我希望我的robots.txt可以访问,但我无法做到这一点。我在这里运行有角度的应用程序,这就是为什么我需要这些重写。
这是我目前在.htaccess中拥有的内容:
RewriteEngine on
RewriteRule ^robots.txt - [L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /index.html [NC,L]
显然不起作用:
apache2-log:[perdir /var/www/app/] applying pattern '^robots.txt' to uri 'index.html'
我在做什么错?
要排除文件,请尝试如下操作:
RewriteCond%{REQUEST_URI}!^ /您的文件名。文件扩展名$