1

Zend 框架我有如下的目录树和 robots.txt 文件,但是当我浏览 www.site.com/robots.txt 时,它说找不到页面错误。我如何告诉 ZF robots.txt 是允许的?

A. 目录树:

www站点/应用程序
网址/图书馆
wwwsite/ZendFramework-1.10.7.ta​​r.gz
www网站/公共
.
|--- 验证码
|
|--- CSS
|--- js
|--- 图像
|--- 文件
|
.htaccess
索引.php
机器人.txt

B..htaccess

重写引擎开启
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
重写规则 ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

谢谢问候

4

1 回答 1

7

解释为什么它不适用于空的 robots.txt:

It's because rewrite cond -s is used which checks if a file is matched but also if the file is greater than 0 in size. If you want to match empty files as well you can use -f instead of -s.

于 2010-08-20T17:50:45.623 回答