为了在Drupal中启用干净的URL,我将下面的行添加到lighttpdconfiguration文件中。
但是,我现在正在本地服务器上工作,我没有可用的域。 所以我需要使用这个地址192.168.75.159:81/Sites/drupal/
我尝试用[“套接字”]replace[“主机”],并用ip和子文件夹(请参阅上面的地址)replace域名,但未成功。 即使我没有域名,我如何设置configuration文件来设置干净的URL?
谢谢
$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") }
我不知道你正在使用什么操作系统,但是你可以在* nix系统和c:\ Windows \ System32 \ Drivers \ etc \ hosts中添加一行到/ etc / hosts,以便映射mywebsite.com(或dev。 mywebsite.com)到127.0.0.1。
或者更好的主意是,如果你在控制DNS只是创build一个像dev.mywebsite.com一个子域的logging,并指向它127.0.0.1。