
我想設定轉發,在其中打開網頁瀏覽器,輸入地址,例如:http://helpdocs
它會將我定向到電腦上包含 HTML 文件的資料夾,例如網站中的資料夾。我考慮過編輯hosts文件,但不知道要修改什麼。我可以使用本地網路伺服器,但我想先嘗試一下。
這可能嗎?
謝謝。
編輯:
編輯後的主機檔案:
127.0.0.1 1.web.docs 1.web.webs #WEBSITES
和配置編輯:
<Directory C:/1web>
Order Deny,Allow
Allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot C:/1web/helpdocs/
ServerName 1.web.docs
</VirtualHost>
<VirtualHost *:80>
DocumentRoot C:/1web/webs/
ServerName 1.web.webs
</VirtualHost>
WAMP 主機配置中已有的行是否可能與之衝突?
答案1
當然,你可以這樣做;只需設定一個 Web 伺服器,例如 apache 或 PWS 等,將其預設網站的根資料夾設定為您的幫助目錄,然後前往
http://localhost
但為什麼不直接做
file://C:/Somewhere/some_file.htm
並為其添加書籤?
根據下面的評論,在您的主機檔案中設置
127.0.0.1 localhost helpdocs webtest
並在 Apache 或 PWS 或任何偵聽這些主機標頭的多個網站中進行設定。
根據您的下一條評論,httpd.conf 可能如下所示(在完成上面的主機編輯後):
<VirtualHost *:80>
DocumentRoot C:/htdocs/help/
ServerName helpdocs
</VirtualHost>
<VirtualHost *:80>
DocumentRoot C:/htdocs/web/
ServerName webtest
</VirtualHost>
(適當調整 DocumentRoot 行...)