Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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"
}
share|improve this question
add comment

4 Answers

up vote 3 down vote accepted

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
share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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