开发者

show php file like a directory with htaccess

hi i want something l开发者_运维百科ike this when user write www.test.com/6

in the behind it will go to http://www.test.com/index.php?id=6 but this is not redirection it will be mod_rewrite

i do something like this but i get internal server error

Options +FollowSymLinks RewriteEngine on RewriteRule ([0-9]*)$ /index.php?id=$1 [L,NC]


I've written a very similar mod_rewrite line for one of my own projects. The regex could probably use some polishing, but it works, so here it is anyway:

RewriteRule ^([0-9]+)(/)?$ /path/to/file.php?id=$1 [QSA]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜