问题
this is what I want to achieve.
I want to rewrite this url http://example.com?page=something to this http://example.com/something
such that i can $_GET whatever is after the url $_GET['page']= 'something'
all the tutorials I've read show it like http: //example.com/page /something so i was wondering if it is possible without the extra "/"
//Update
this is what i have on the.httaccess file
RewriteEngine on RewriteRule ^(.*)/?$ index.php?page=$1 [L]
but when i do a echo($_GET['page'] ); i get index.php
回答1:
try this:
RewriteEngine on
Options +FollowSymLinks
RewriteRule ^something/?$ /something.php
回答2:
It needs to accept a parameter though
RewriteRule ^(.*)/?$ index.php?page=$1 [L]
来源:https://stackoverflow.com/questions/9299793/apache-htaccess-rewriting