tags:

views:

15

answers:

2

This is my htacess file:

RewriteEngine on    
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^(.*)\.mydomain\.com(.*)
RewriteRule .* inside.php?tx=%1&filter=%2 

This url: hello.mydomain.com goes to www.mydomain.com/inside.php?tx=hello Thats correct.

Now i need this url hello.mydomain.com/bye/ goes to www.mydomain.com/inside.php?tx=hello&filter=bye, but don't work. Only goes to www.mydomain.com/inside.php?tx=hello

This htaccess is ignoring the second variable (bye). Help please.

A: 

I'm not very good at this, but I'll try to help.

It is possible that & is some special symbol. You should try to \ escape everything except for letters and numbers

BlaXpirit
A: 

%{HTTP_HOST} only contains the host name (hello.mydomain.com), so your second backreference doesn't have anything in it. Changing your RewriteRule to the following should give the behaviour you're expecting:

RewriteRule ^([^/]*) inside.php?tx=%1&filter=$1 

Edit: To correct the situation described in your comment, the entire ruleset should be as follows:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^(.*)\.mydomain\.com(.*)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]*) inside.php?tx=%1&filter=$1
Tim Stone
Steven
See my edit, that should fix that issue.
Tim Stone
Works fine! Thank you!
Steven