如何重写的.php与mod_rewrite的规则为.html [英] How to rewrite .php to .html with mod_rewrite rules
本文介绍了如何重写的.php与mod_rewrite的规则为.html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Prolly容易的..我想上晚自习mod_rewrite的跑进一个问题
下面是我的网址
example.com/index.php?id=1&title=some_title
我希望页面能够采取
example.com/1/some_title.html
我将如何做呢?
解决方案
选项+的FollowSymLinks
RewriteEngine叙述上
重写规则/ \\ $ HTML的index.php的id = $ 1安培(*)(*);?标题= $ 16
Prolly an easy one.. I am trying to study up on mod_rewrite and ran into an issue
Here is my url
example.com/index.php?id=1&title=some_title
I want the page to be able to take
example.com/1/some_title.html
How would I do that?
解决方案
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)/(.*)\.html$ index.php?id=$1&title=$2
这篇关于如何重写的.php与mod_rewrite的规则为.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文