HTML 5 Boilerplate HTACCESS 停止我的 mod_rewrite 工作

发布于 2024-12-28 08:18:56 字数 485 浏览 1 评论 0原文

我正在使用未经编辑的 HTML5 BP 的 .htaccess 文件。一切工作正常,直到我添加自己的重写规则:

Options +FollowSymlinks

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-z]+-?[a-z]+)/$ /$1.php

如果将其添加到它自己的 .htaccess 文件(启动引擎并添加选项后),则效果很好,但添加到 html5 BP 的文件时则不然。我尝试将其放在整个文档中、if 标记内、文档顶部和底部。

重写应该使用 /example.php 加载 /example ,当与 h5bp 一起使用时,我收到 404 错误。

I'm using HTML5 BP's .htaccess file unedited. Everything works fine until I add my own rewrite rule:

Options +FollowSymlinks

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-z]+-?[a-z]+)/$ /$1.php

this works fine if add it to it's own .htaccess file (after starting the engine and adding options) but does not when added to the html5 BP's file . I've tried placing it all over the document, inside the if tags, top of the doc and bottom.

The rewrite should load /example with /example.php , when using with h5bp I receive a 404 error .

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

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

发布评论

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

评论(1

幻梦 2025-01-04 08:18:56

从 h5bp 中删除行 Options -MultiViews

Removing the line Options -MultiViews from the h5bp

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