开发者

How to rewrite .php to .html with mod_rewrite rules

开发者 https://www.devze.com 2023-03-08 19:19 出处:网络
Prolly an easy one.. I am trying to study up on mod_rewrite and ran into an issue Here开发者_Go百科 is my url

Prolly an easy one.. I am trying to study up on mod_rewrite and ran into an issue

Here开发者_Go百科 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?


RewriteEngine on
RewriteRule ^(\d+)/(\w+).html$ index.php?id=$1&title=$2


Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)/(.*)\.html$ index.php?id=$1&title=$2                   
0

精彩评论

暂无评论...
验证码 换一张
取 消