防止非控制器的事物丢失控制器错误
我的电子邮件信箱充满了诸如“错误:Robots.txtController 无法找到”之类的错误。和错误:找不到 CssController。我计划能够将 cake 配置为不会在 favicon.ico、丢失图像等方面出现丢失控制器错误。htaccess
文件是:
<IfModule mod_rewrite.c>
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{QUERY_STRING} ^module(.*)$
RewriteRule ^(.*)$ index.php?url=system_fields/route/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
我怎样才能防止此类错误?
My email box is filling up with errors like Error: Robots.txtController could not be found. and Error: CssController could not be found. I planned to be able to configure cake to not blow missing controller errors on things like favicon.ico, missing images, etc.
The htaccess file is:
<IfModule mod_rewrite.c>
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{QUERY_STRING} ^module(.*)$
RewriteRule ^(.*)$ index.php?url=system_fields/route/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
How can I prevent these kinds of errors?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
纠正错误比预防错误更好。例如,如果您看到 Robots.txtController 错误,则应将 Robots.txt 添加到您的 webroot。这不仅可以防止错误,而且实际上会在请求时提供 Robots.txt 文件。您看到的其他错误也是如此。
It's better to fix the errors than to prevent them. For example, if you are seeing Robots.txtController errors, you should add the Robots.txt to your webroot. This will not only prevent the error, it will actually serve up the Robots.txt file when requested. The same would go for the other errors you are seeing.