0

I'm trying to match a referer to a host name in my .htaccess and stumbled upon the following.

The condition reads:

RewriteCond %{HTTP_REFERER} ^https://%{HTTP_HOST}.*$

But this never matches, and the log file for mod_rewrite states this:

RewriteCond: input='https://mysite.com/test.htm' pattern='^https://%{HTTP_HOST}.*$' => not-matched

Why is the HTTP_HOST variable not getting expanded in this condition?

1 Answer 1

1

This is expected behavior. See here and here for details / workarounds.

1
  • So it appears there is no way to work around my particular issue, where I want to substitute host name into the comparison?
    – SaltyNuts
    Jul 26, 2012 at 15:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .