希望是一个我无法找到答案的快速问题。我已经在端口8080上成功地在wamp中设置了一个虚拟主机(因为iis占用了80)但我的站点位置仍然尝试通过端口80访问所有资源和文件夹。
这是我的设置(按照指南http://forum.wampserver.com/read.php?2,127757)
在httpd-vhost.conf中
<VirtualHost *:8080>
DocumentRoot "C:/dev/frontend"
ServerName test.local
ServerAlias *.test.local
<Directory "C:/dev/frontend">
AllowOverride All
Require all granted
</Directory>
php_flag display_errors Off
php_flag log_errors On
php_value max_upload_size 40M
php_value max_execution_time 120
php_value error_log "C:/wamp/logs/example_com_phperror.log"
</VirtualHost>
<VirtualHost *:8080>
ServerName localhost
ServerAlias localhost
DocumentRoot "C:/wamp/www"
ErrorLog "logs/errors.log"
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from all
</Directory>
</VirtualHost>
在httpd -t
中检查bin文件夹中运行oki的语法。在我的httpd.conf中,它也设置为侦听端口8080。
我的主机文件也应该设置正确:
127.0.0.1 test.local
::1 test.local
但子文件夹和资产仍然是错误的端口:
http://test.local:80/assets/css/bootstrap.css
C:\inetpub\wwwroot\assets\css\bootstrap.css
那么我错过了什么?