开发者

How to allow /X/ instead of ?ID=X access in URLs? [duplicate]

This question already has answers here: Mod-rewrite url from /example.php?id=1 to /example/title-of-page 开发者_如何学编程 (3 answers) Closed 9 years ago.

On me and my friends site we are wondering how to get ?ID=$ID just to show as a folder such as http://host/profiles/1/

We are guessing htaccess is required, but how is this done? Thanks.


Something like this should work for you:

RewriteEngine On
RewriteRule ^profiles/(\d+)/$ /profile?id=$1 [L]

It rewrites globalschat.co.cc/profiles/1/ to globalschat.co.cc/profile?id=1

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜