简体   繁体   English

XAMPP虚拟主机的不同名称

[英]Different names for XAMPP virtual hosts

I've set up XAMPP (on Windows 7) to use virtual hosts in a simple manner. 我已经设置了XAMPP(在Windows 7上),以一种简单的方式使用虚拟主机。 localhost:80 points to Apache's htdocs folder, and localhost:81 points to D:\\Projects\\ . localhost:80指向Apache的htdocs文件夹,而localhost:81指向D:\\Projects\\ This works like a charm. 这就像一个魅力。

However, I would like to be able to access my projects folder using not only http://localhost:81/ , but also using http://projects/ . 但是,我希望不仅可以使用http://localhost:81/ ,而且还可以使用http://projects/来访问我的项目文件夹。 Windows' hosts file doesn't care about ports - how can I achieve this? Windows的hosts文件不关心端口-如何实现?

This seems relevant to setting up multiple virtual hosts on XAMPP for windows 7 . 这似乎与在Windows 7的XAMPP上设置多个虚拟主机有关

I'm not sure using ports is the best approach. 我不确定使用端口是否是最佳方法。 You might be better off setting up entirely different domain names to redirect to the correct local directory. 您最好设置完全不同的域名以重定向到正确的本地目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM