Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In order to enable clean urls in Drupal, I add the lines below to the lighttpd configuration file.

However I'm now working on a local server and I don't have a domain available. So I need to work with this address

I've tried to replace ["host"] with ["socket"] and replace the domain with ip and subfolders (see address above), but unsuccessfully. How can I set the configuration file to set clean urls even if I don't have a domain ?


$HTTP["host"] =~ "(^|\.)mywebsite\.com" {
  server.document-root = "/var/www/sites/mywebsite"
  server.errorlog = "/var/log/lighttpd/mywebsite/error.log" = ""
  accesslog.filename = "/var/log/lighttpd/mywebsite/access.log"
  include_shell "./"

  url.access-deny += ( "~", ".inc", ".engine", ".install", ".info",
       ".module", ".sh", "sql", ".theme",
       ".tpl.php", ".xtmpl", "Entries",
       "Repository", "Root" )

  # "Fix" for Drupal SA-2006-006, requires lighttpd 1.4.13 or above
  # Only serve .php files of the drupal base directory
  $HTTP["url"] =~ "^/.*/.*\.php$" {
      fastcgi.server = ()
      url.access-deny = ("")

  magnet.attract-physical-path-to = ("/etc/lighttpd/drupal-lua-scripts/p-.lua")

share|improve this question
up vote 1 down vote accepted

I don't know what OS you are using but you can add a line to /etc/hosts on *nix systems and c:\Windows\System32\Drivers\etc\hosts that allow you to map (or to

Or a better idea would be if you are in control of DNS just create a subdomain A record like and point it to

share|improve this answer
Not sure my question was clear. I've actually done what you wrote but it doesn't work. I've replaced $HTTP["host"] =~ "(^|\.)mywebsite\.com" with $HTTP["host"] =~ "" – Patrick Dec 27 '10 at 15:58
I don't think you understand my response, what you would do is "trick" your computer into using a hostname but point the hostname wherever you want. So, I think instead of you probably want And even if you put the record into DNS - it doesn't mean that other people will be able to access it, which I think is the easiest way. – Nathan Adams Jan 2 '11 at 17:08

Your Answer


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.