sách gpt4 ai đã đi

xampp - Cần trợ giúp về dịch vụ lưu trữ web xampp

In lại 作者:行者123 更新时间:2023-12-04 02:42:46 28 4
mua khóa gpt4 Nike

我正在使用 XAMPP,Apache 2.2.17。我添加了虚拟主机,但我的虚拟主机和 localhost 都指向同一个位置。这是我在 httpd-vhosts.conf 中的代码


ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot "C:/xampp/htdocs/workspace/testsite"



DocumentRoot "C:/xampp/htdocs/xampp"
ServerAlias localhost
ServerName localhost


使用上面的代码,我得到了带有 www.domain.tld 的 testsite,这样很好。但是如果我输入localhost,它也会去testsite。如果我在测试站点之前移动,那么 localhost 会转到 localhost good,而 www.domain.tld 也会转到 localhost。我为 localhost 尝试了不同的设置



并从 domain.tld 中删除 *.domain.tld 但没有任何效果。我错过了一些明显的东西吗?

1 Câu trả lời

我自己的答案:以下代码解决了问题

 <--- * fixed the problem, apache 2.2 doc does say it must match www.domain.tld, which caused problem for other Virtual hosts
ServerName www.domain.tld
ServerAlias domain.tld
DocumentRoot "C:/xampp/htdocs/workspace/patriot2"



DocumentRoot "C:/xampp/htdocs/xampp"
ServerAlias localhost
ServerName localhost

关于xampp - 需要有关 xampp 虚拟主机的帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7270787/

28 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com