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.

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 192.168.75.159:81/Sites/drupal/

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 ?

thanks

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

  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

1 Answer 1

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 mywebsite.com (or dev.mywebsite.com) to 127.0.0.1.

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

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"] =~ "192.168.75.159:81/Sites/drupal/" –  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 127.0.0.1 you probably want 192.168.75.159. 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

 
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.