2

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?

Thanks.

Justin
  • 5,328
  • 19
  • 64
  • 84

1 Answers1

2
$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.

Shane Madden
  • 114,520
  • 13
  • 181
  • 251