Rewriterule end slash

Posted by Maxime on Stack Overflow See other posts from Stack Overflow or by Maxime
Published on 2010-05-27T15:18:46Z Indexed on 2010/05/27 15:21 UTC
Read the original article Hit count: 243

Filed under:
|
|

Hi,

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?band=$1&song=$2 [L]
RewriteRule ^(.*)\/(.*)$  index.php?band=$1&song=$2 [L]

© Stack Overflow or respective owner

Related posts about web

Related posts about url