Add querystring constant by requested host

Topics: Developer Forum
Oct 12, 2009 at 9:44 AM


...I can't match the exact rule to do this: I have some domains (,, that point to the same website root.

If I call (or I need iirf to rewrite the request always adding a querystring constant like id=a.

The same with the other domains:   ->  ?id=b + other querystring   ->  ?id=c + other querystring


Oct 12, 2009 at 9:32 PM

and what have you tried so far?

    rewritecond  %{HOST}          ^(?!www)(.+)\.com$   [I]
    rewriterule  ^/([^\?]*)       $1?id=%1             [L,QSA]  
    rewritecond  %{HOST}          ^www\.(.+)\.com$     [I]
    rewriterule  ^/([^\?]*)       $1?id=%1             [L,QSA]