将 URL 变量重写为 HTML 文件
我见过很多这些重写问题的案例,但我没有得到所有常规表达式和浏览器错误等,所以我希望有人可以帮助我。
好的,我有一个带有 url 变量“pages.php?p=foo”的文件,我想重写它,以便它在同一目录中显示为“foo.html”。
我的想法是这样的:
RewriteRule (.+).html pages.php?p=$1
问题是,浏览器显示 400 Bad Request 错误。
我希望能解决这个问题,但我无法解决这个问题。
非常感谢任何帮助:)
I've seen many cases of these rewrite questions but I don't get all the regular experessions and browser errors and such so I was hoping that someone could help me.
Ok, so I have a file with a url variable 'pages.php?p=foo' and I would like to rewrite it so that it appears as 'foo.html' in the same directory.
I was thinking along the lines of:
RewriteRule (.+).html pages.php?p=$1
The trouble is, the browser displays 400 Bad Request errors.
I'm hoping there's a fix for this but I can't get my head around it.
Any help is much appreciated :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Try this: