this is the htaccess file on the server
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www. RewriteCond %{HTTP_HOST} ^([a-z0-9]+)\.domain.com(.*)$ RewriteRule ^(.*)$ http://domain.com/test\.php?user=%1&path=%2 [R]
According to my understanding of the above code, if I request asher.domain.com/user , it should rewrite to http://domain.com/test.php?user=asher& path = / user correctly?
Instead, I get http://domain.com/test.php?user=asher&path=% 2 empty. but if I use $ 1 instead of % 2 , I get the correct result.
I could make the most stupid mistake, but I'm not sure where I made a mistake. Help me guys? where is the error in the rewrite rules that% 2 does not work for me?
source share