.htaccess:脚本'index\\.php'未找到或无法统计

发布于 2024-10-07 00:21:56 字数 489 浏览 0 评论 0原文

为此,我的日志中出现了很多错误:

脚本“/var/www/vhosts/mysite.com/httpdocs/index\\.php”未找到或无法统计

(是的,2 x '\')

根目录中有一个index.php文件,并且我'我们尝试了许多 .htaccess 方法来摆脱 index\.php,但要么会导致问题(因为某些 index.php 链接是有效的),要么就是拒绝工作。

有谁知道是什么原因导致这个问题?

我确实使用 mod_rewrite 进行重定向,如下所示:

RewriteRule ^search/(.*)/? index\.php?search=$1 [NC,L]

重定向中的 index.php 是否导致错误?

如何使用 .htaccess 将对 index\\.php 的调用重定向到主页?

谢谢, 科林

I'm getting lots of errors in my log for this:

script '/var/www/vhosts/mysite.com/httpdocs/index\\.php' not found or unable to stat

(Yes, 2 x '\')

There is an index.php file in the root, and I've tried many .htaccess methods to get rid of index\.php, but either it causes problems (as some index.php links are valid) or just refuses to work.

Does anyone know what is causing this problem?

I do use mod_rewrite to redirect like so:

RewriteRule ^search/(.*)/? index\.php?search=$1 [NC,L]

is the index.php in the redirect causing the error?

How can I use .htaccess to redirect calls to index\\.php to the homepage?

Thanks,
Colin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

七月上 2024-10-14 00:21:56

您为什么要尝试重定向、浏览或包含index\.php?为什么不只是index.php?

Why are you trying to redirect, browse to, or include index\.php at all? Why not just index.php?

好久不见√ 2024-10-14 00:21:56

RewriteRule ^搜索/(.*)/? index.php?search=$1 [NC,L]

RewriteRule ^search/(.*)/? index.php?search=$1 [NC,L]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文