mod_rewrite 问题,可能与服务器配置有关?

发布于 2025-01-05 02:44:22 字数 275 浏览 1 评论 0原文

我有以下代码:

RewriteEngine on
RewriteRule ^example/? test.php

当我点击 www.example.com/example 时,我给出以下内容:

在此服务器上找不到请求的 URL /m/f/example.com/public/test.php。

我已检查该模块是否已安装,它似乎正在执行某些操作,但无法正确显示文件。 Public 是站点所有文件所在的位置,test.php 也在那里。

I have the following code:

RewriteEngine on
RewriteRule ^example/? test.php

When I hit www.example.com/example I gives me the following:

The requested URL /m/f/example.com/public/test.php was not found on this server.

I have checked that the module is installed and it seems to be doing something, but won't display the file correctly. Public is where all the files of the site are and the test.php is there as well.

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

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

发布评论

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

评论(1

永不分离 2025-01-12 02:44:22

您需要一个RewriteBase

添加行:

RewriteBase /

You need a RewriteBase.

Add the line:

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