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