HTTP 406 - 不可接受 - 从 .php 文件重定向
我正在开发一个专有的 CMS,在 .htaccess 文件中,我有一个从 .php 文件到非 php 地址的 URL,并且收到 406 错误:
DirectorySlash Off
RewriteEngine on
RewriteRule ^news-and-information/WhyAuditQualityMatters.php$ http://%{http_host}/news-detail/insight-e-news-september-2011-why-audit-quality-matters [L]
RewriteRule ^theme/([^/]*)/(.*)$ themes/$1/public/$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
除第 3 行之外的所有行都是 CMS 的一部分
I am working on a proprietary CMS, inside the .htaccess file I have a URL going from a .php file to a non php address and I am getting 406 error:
DirectorySlash Off
RewriteEngine on
RewriteRule ^news-and-information/WhyAuditQualityMatters.php$ http://%{http_host}/news-detail/insight-e-news-september-2011-why-audit-quality-matters [L]
RewriteRule ^theme/([^/]*)/(.*)$ themes/$1/public/$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
All lines are part of the CMS other than Line 3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在第 3 行添加
R=302
,以获得[L,R=302]
。因为这似乎是一个重定向规则。或者通过不使用 mod-rewrite 来让你的生活简单而快乐东西,并使用 Redirect 和 RedirectMatch 说明。当它起作用时,更改
temp
关键字并使用permanent
代替。Try to add a
R=302
in this 3rd line, to have[L,R=302]
. As it seems to be a redirect rule. Or keep your life simple and happy by not using mod-rewrite for simple things, and write your redirect with Redirect and RedirectMatch instructions.When it will work alter the
temp
keyword and putpermanent
instead.