开发者

Using mod_rewrite to remove PHP path detail

I can't seem to get Example 1 to turn into Example 2 using mod_rewrite.

Example 1

http://www.example.com/info/index.php?uid=123

Example 2

http:开发者_StackOverflow中文版//www.example.com/123

Mod rewrite code.

Options +FollowSymLinks
Options -Indexes
RewriteEngine on
RewriteBase /info

RewriteRule ^([^/]*)$ /info/index.php?uid=$1 [L]

What can I try next?


RewriteCond %{HTTP_HOST} ^www.example.com(:80)?$ [NC]        
RewriteCond %{QUERY_STRING}     ^uid=(.*)$    [NC]
RewriteRule ^/info/index\.php$ http://www.example.com/%1? [NC,L,R=301]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜