I am using lighttpd web server and mod_write and have a simple host match expression:

$HTTP["host"] =~ "domain\.com$" {

The problem is this is matching test.domain.com as well. How do I modify the expression to only match http://domain.com but not any subdomains such as test.domain.com?


$HTTP["host"] =~ "^domain\.com$" {

The ^ character specifies that the start of the string must be at this position; it won't match if there's anything before domain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.