簡體   English   中英

如何使用相同的父服務器別名或名稱在 xampp 中設置虛擬主機

[英]How to setup virtual hosts in xampp with same parent server alias or name

我想在本地 xampp 環境中設置 2 個虛擬主機,我有兩個不同的 WordPress 網址

test.comtest.com/blog

現在我想為本地設置虛擬主機,如test.localtest.local/blog

test.local 有效,但 test.local/blog 重定向到 test.local 的 404 頁面

xampp 虛擬主機配置:

<VirtualHost *:80>
    DocumentRoot "/xampp/htdocs/test.com"
    ServerName test.local
</VirtualHost>

<VirtualHost *:80>
    ServerName test.local/blog
    DocumentRoot "/xampp/htdocs/blog-test.com"
 </VirtualHost>

主機文件設置:

127.0.0.1       test.local
127.0.0.1       test.local/blog

配置虛擬主機時,ServerName 可以用於 2 個或更多不同的域。

您沒有不同的域。

test.com 和 test.com/blog 是同一個域。

相似地

test.local 和 test.local/blog 是同一個域

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM