Search code examples
regex.htaccessmod-rewriteslash

regex and getting slashes plus characters from a url


Why doesnt this rule return slashes with characters?

RewriteRule ^test/(.+)/(.+)/(.+)/?$ test.php?one=$1&two=$2&three=$3

For example in this URL

mysite.com/test//one///two////three///

It'll return

$1='one' 

$2='two' 

$3='three' 

But I want it to return

$1='/one' 

$2='//two' 

$3='///three///' 

I also tried ^posts/{1}(.+)/{1}(.+)/{1}(.+)/?$ but it did't work too...

nothing else comes to my mind. Can anyone help?

Thanks in advance


Solution

  • The URL may have been processed before by the server, removing double slashes. If you match the full URL, are all slashes still there?