1

My website does not appear when I navigate to www.url.com, but it does work for url.com

This is my lighttpd config:

$HTTP["host"] =~ "^url.com$" {
  server.document-root = "/home/a/www/url.com"
  server.error-handler-404 = "/index.php"
}
verhogen
  • 333
  • 2
  • 4
  • 14

4 Answers4

3

Emthigious is only partially correct,

$HTTP["host"] =~ "url.com$" {

is a somewhat ambiguous match it would match www.url.com but it would also match

  • anotherurl.com
  • someotherurl.com
  • mail.url.com

etc

a better solution would be:

    $HTTP["host"] =~ "^(www\.)?url.com$" {

This will only match:

  • url.com
  • www.url.com
1

emills is right, you'll have to change the regex to

$HTTP["host"] =~ "url.com$" {

Now everything that ends with "url.com" wil be caught by the host-definition.

Emthigious
  • 141
  • 1
0

I don't know much about lighttpd but the ^ at the beginning of "^url.com$" looks like it means "starts with" which means that only exactly "url.com" will be accepted by that declaration.

emills
  • 774
  • 1
  • 4
  • 15
0

Who manages the authoritative name server url.com? You could just add an entry for 'www' pointing to your web server.

Nikolas Sakic
  • 492
  • 2
  • 8