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]
精彩评论