问题
I am sick of this kind of URL:
www.domain.com/something/?id=person&photos=photoID&variable1=others&...
I am using apache, learning to write .htaccess now. Can anyone show me the basic code for this one?
Ugly:
www.domain.com/something/?id=person&photos=photoID
Goal:
www.domain.com/something/person/photoID
回答1:
RewriteEngine on
RewriteRule ^something/(.*)/(.*)$ something/?id=$1&photos=$2 [QSA]
回答2:
This is an extremely helpful article on Mod_Rewrite
来源:https://stackoverflow.com/questions/2824275/how-to-beautify-the-url