我如何重写的.php使用的.htaccess规则为.html? [英] How do I rewrite .php to .html using .htaccess rules?
问题描述
我想用的.php
扩展转换为的.html
延长的.htaccess
规则
这是我能够做到的,如果是的话,怎么办?
RewriteEngine叙述上
重写规则^(。*)\。HTML $ $ 1.PHP [NC]
使用了mod_rewrite。 $ 1表示正则表达式的第一部分和[NC]表示不区分大小写。
您可以看看这篇文章:<一个href="http://roshanbh.com.np/2008/02/hide-php-url-rewriting-htaccess.html">http://roshanbh.com.np/2008/02/hide-php-url-rewriting-htaccess.html
编辑: 删除一条线。你不需要,我认为。 此外,谈到我所做的。
I want to convert .php
extension to .html
extension using .htaccess
rules
Is this something I can do, and if so, how?
RewriteEngine on
RewriteRule ^(.*)\.html$ $1.php [nc]
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.
这篇关于我如何重写的.php使用的.htaccess规则为.html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!