如何使用 .htaccess 规则将 .php 重写为 .html?
我想使用 .htaccess
规则将 .php
扩展名转换为 .html
扩展名
这是我可以做的事情吗?如果可以,如何做?
I want to convert .php
extension to .html
extension using .htaccess
rules
Is this something I can do, and if so, how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用mod_rewrite。 $1 表示正则表达式的第一部分,[nc] 表示不区分大小写。
您可以看看这篇文章: http:// roshanbh.com.np/2008/02/hide-php-url-rewriting-htaccess.html
编辑:
删除了一行。我想你不需要这样。
另外,对我所做的事情发表评论。
Uses mod_rewrite. $1 indicates first part of the regex and [nc] means not case sensitive.
You can take a look at this article: http://roshanbh.com.np/2008/02/hide-php-url-rewriting-htaccess.html
EDIT:
Removed a line. You do not need that I think.
Also, commented on what I did.
也许尝试一下
Maybe try