我有一个名为“ my-new-project”的项目(仅是示例)。使用laragon自动虚拟主机名功能,我可以通过http://my-new-project.test/浏览此项目。
是否可以使用其他名称而不是该项目名称浏览该项目,例如... http://project.test/?
另外,位于启用C:\ laragon \ etc \ apache2 \ sites的.conf文件中的ServerName和ServerAlias是什么?
简单的解决方案就是欺骗!用该文件夹project
旁边的名称创建另一个文件my-new-project
夹。然后转到C:\laragon\etc\apache2\sites-enabled
path并进行编辑auto.project.test.conf
。编辑这些:
<VirtualHost *:80>
DocumentRoot "C:/laragon/www/project"
ServerName project.test
ServerAlias *.project.test
<Directory "C:/laragon/www/project">
AllowOverride All
Require all granted
</Directory>
这些:
<VirtualHost *:80>
DocumentRoot "C:/laragon/www/my-new-project"
ServerName project.test
ServerAlias *.project.test
<Directory "C:/laragon/www/my-new-project">
AllowOverride All
Require all granted
</Directory>
这是简单的方法。
对于这个问题:
另外,位于启用C:\ laragon \ etc \ apache2 \ sites的.conf文件中的ServerName和ServerAlias是什么?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句