I'm working on a Rewriterule in order to have URLs like these: http://www.myhost.com/var1/var2/
RewriteRule ^(.*)\/(.*)\/$ index.php?var1=$1&var2=$2 [L]
What I would like to add is that when someone types myhost.com/var1/var2 (without the end slash), it still goes to the same page.
Is there a better way to do it than this?
RewriteRule ^(.*)\/(.*)\/$ index.php?var1=$1&var2=$2 [L]
RewriteRule ^(.*开发者_如何学JAVA)\/(.*)$ index.php?var1=$1&var2=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\/]*)\/([^\/]*)\/?$ index.php?band=$1&song=$2 [L]
Note the ending ?
精彩评论