在本地设置域名进行测试?
我将使用一个托管帐户,其中停放了多个域名以及一个主域名。我需要能够根据访问的域显示不同的内容。所以,我的问题是,如何在本地进行测试?
- 我有 Vista
- 我使用 XAMPP
对此有任何帮助吗?
I will be using one hosting account with several domains parked on it along with a main domain name. I need to be able to show different content based on what domain is being accessed. So, my question is, how can I test this locally?
- I have Vista
- I use XAMPP
Any help with this would be greatly appreciated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在主机文件中定义多个域。
你可以在C:\Windows\System32\drivers\etc中找到它,
那里有一些示例可以帮助你理解它是如何工作的。然后创建一个页面(例如index.php)并解析那里的域并将其重定向到相关域。
You can define multiple domains in your hosts file.
you can find it C:\Windows\System32\drivers\etc
There are examples written there to help you understand, how it works. then create a page lets say index.php and parse the domain there and redirect it to relevant domain.