开发者

Rewriterule end slash

开发者 https://www.devze.com 2023-01-01 10:38 出处:网络
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]

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 ?

0

精彩评论

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