도메인이 없는 경우 어떻게 깨끗한 URL을 설정(재작성 활성화)할 수 있나요?

도메인이 없는 경우 어떻게 깨끗한 URL을 설정(재작성 활성화)할 수 있나요?

Drupal에서 클린 URL을 활성화하기 위해 lighttpd 구성 파일에 아래 줄을 추가합니다.

그러나 지금은 로컬 서버에서 작업 중이고 사용 가능한 도메인이 없습니다. 따라서 이 주소 192.168.75.159:81/Sites/drupal/로 작업해야 합니다.

["host"]를 ["socket"]으로 바꾸고 도메인을 ip 및 하위 폴더(위 주소 참조)로 바꾸려고 시도했지만 실패했습니다. 도메인이 없어도 깨끗한 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")

}

답변1

어떤 OS를 사용하고 있는지는 모르겠지만 *nix 시스템의 /etc/hosts 및 c:\Windows\System32\Drivers\etc\hosts에 줄을 추가하면 mywebsite.com(또는 dev. mywebsite.com)을 127.0.0.1로 변경하세요.

또는 DNS를 제어할 수 있는 경우 dev.mywebsite.com과 같은 하위 도메인 A 레코드를 만들고 127.0.0.1을 가리키는 것이 더 좋은 방법입니다.

관련 정보