.htaccess 300 处理

发布于 2024-09-29 21:40:03 字数 155 浏览 1 评论 0原文

我有一个页面 mypage.html,我需要将其更改为 mypage.php。如果我上传 mypage.php 并删除 mypage.html,我会从 Apache 收到 300 多项选择错误。

我可以设置 htaccess 以在显示错误之前检查页面的 .php 版本是否可用吗?

I have a page mypage.html which I need to change to mypage.php. If I upload mypage.php and remove mypage.html, I get a 300 Multiple Choice error from Apache.

Can I set the htaccess to check if a .php verion of a page is available before it shows an error?

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

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

发布评论

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

评论(1

幻想少年梦 2024-10-06 21:40:03

绝对可以。适用相同的重写规则,只是规则不同。

重写基础 /

错误文档 300 /error.php

您可以将 error.php 更改为您想要的任何内容。只需确保保持相对路径相同即可。 IE:

/ = 根路径/错误/ = 根路径/错误

可能不是您正在寻找的答案,但可能会给您一个开始。

Absolutely you can. same Rewrite rules apply, just a different rule.

RewriteBase /

ErrorDocument 300 /error.php

You can change the error.php to whatever you want. Just have to ensure that you keep the relative paths the same. IE:

/ = root path /error/ = root path/error

Probably not the answer your looking for, but may give you a start.

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