...

View Full Version : Simple regex problem - please help.



jeddi
03-01-2012, 12:38 PM
Hi ,

My simple redirect is working EXCEPT if there is a period in the
string.

This is what I have:



RewriteCond %{HTTP_HOST} ^([^.]+).example.net [NC]
RewriteCond %{HTTP_HOST} !^www.example.net [NC]

RewriteRule ^.*$ http://example.net/disp_page.php?a=%1 [NC,QSA,L]



So this works fine with :

potatoes.example.net

that goes to example.net/disp_page.php?a=potatoes

and the page displays :)

BUT if I have

recipes.potatoes.example.net

then it doesn't work :confused:

It should go to : example.net/disp_page.php?a=recipes.potatoes

Which would work fine.

Does any one know how I should adjust my code above ?

Thanks.



.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum