开发者

Simple question about htaccess rewrite

开发者 https://www.devze.com 2023-01-28 01:39 出处:网络
I don\'t know much about rewrite, I would like to do the following thing... I have http://www.website.com/web.php?id=3

I don't know much about rewrite, I would like to do the following thing...

I have http://www.website.com/web.php?id=3

But I would like http://www.website.com/web/title/3

is this possible? (title is the url web title开发者_开发问答 tag)

Thanks.


yes it is possible. you can add following in .htaccess file

RewriteEngine on
RewriteRule ^web/([a-zA-Z0-9_-]+)/([0-9]+)\$ web.php?id=$2

more tips: http://roshanbh.com.np/2008/03/url-rewriting-examples-htaccess.html

0

精彩评论

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