开发者

Remove index.php?var= from URL with .htaccess

I have a url with a parameter in it. For instance:

domain.com/guidelines/index.php开发者_StackOverflow?doc=html 

I want to convert this to:

domain.com/guidelines/html

I know it is possible with .htaccess but I can't seem to get it to work.

Thoughts?


To access the param in php with $_GET['doc'], and have the user see the clean url /guidelines/html you can rewrite as follows:

RewriteBase /
RewriteRule ^/guidelines/(.*)$ /guidelines/index.php?doc=$1 [NC]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜