Apache VirtualHost:如何为不同于80的端口命名服务器名称
我使用Xampp,希望test.localhost转到127.0.0.1:81 在httpd.conf中,我写道:Apache VirtualHost:如何为不同于80的端口命名服务器名称,apache,xampp,port,virtualhost,httpd.conf,Apache,Xampp,Port,Virtualhost,Httpd.conf,我使用Xampp,希望test.localhost转到127.0.0.1:81 在httpd.conf中,我写道: Listen 127.0.0.1:81 NameVirtualHost 127.0.0.1:81 <VirtualHost 127.0.0.1:81> ServerName test.localhost DocumentRoot "d:\_projects\projectx" DirectoryIndex index.php </VirtualHost>
Listen 127.0.0.1:81
NameVirtualHost 127.0.0.1:81
<VirtualHost 127.0.0.1:81>
ServerName test.localhost
DocumentRoot "d:\_projects\projectx"
DirectoryIndex index.php
</VirtualHost>
但是http://test.localhost 现在让我讲127.0.0.1:80
如何使其转到127.0.0.1:81?就您的浏览器而言,http://test.localhost 是http://test.localhost:80. 您需要的是Apache重定向
<VirtualHost 127.0.0.1:80>
ServerName test.localhost
Redirect / http://test.localhost:81
</VirtualHost>
就您的浏览器而言,http://test.localhost 是http://test.localhost:80. 您需要的是Apache重定向
<VirtualHost 127.0.0.1:80>
ServerName test.localhost
Redirect / http://test.localhost:81
</VirtualHost>
或者直接进入浏览器,而不是使用重定向 或者直接进入浏览器而不是使用重定向 嗯,我明白了。但是我在端口80上已经有了其他东西-所以我实际上不想重定向。不过,你是一个技术上正确的人,所以你应该打勾。嗯,我明白了。但是我在端口80上已经有了其他东西-所以我实际上不想重定向。不过,你是一个技术上正确的人,所以你应该打勾。