0
我有以下.htaccess,我试图在/public/robots.php中执行/robots.txt。 我尝试不同的方法,但没有执行我的PHP脚本...Zend Framework 1自定义robots.txt在.htaccess中
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/css application/x-javascript application/javascript text/html text/plain text/xml text/json application/json
</IfModule>
SetEnv APPLICATION_ENV "development"
php_flag magic_quotes_gpc off
php_flag register_globals off
php_flag short_open_tag on
RewriteEngine on
RewriteRule !\.(ico|js|css|jpeg|jpg|png|bmp|gif|pdf|doc|docx|xls|xlsx|xmlx|xml|pps|eml|txt|psd|flv|swf|fla|mp3|ttf|eot|svg|woff|zip)$ public/index.php [NC,L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ public/$1 [L]
我如何使用动态的robots.txt,执行/public/robots.php?
Thx!
当您从浏览器请求/robots.txt时,您会得到什么结果?特别是状态码和任何错误输出?另外,如果直接请求/public/robots.php,会得到什么结果? – plasticinsect 2014-10-07 19:54:02
robots.txt返回404找不到。和robots.php返回'Mensagem:没有路线匹配请求' – 2014-10-07 19:55:55
我解决了这个问题,我会在这里发布我的解决方案 – 2014-10-07 19:59:21