XAMPP安裝過程不細述了,先來簡單回顧一下XAMPP配置:
\xampp\apache\conf\extra\httpd-vhosts.conf
<VirtualHost *:80> ServerAdmin postmaster@domain.td DocumentRoot "盤符:/路徑/項目目錄" ServerName domain.td # domain.td 為自定義服務器名,只要你喜歡...隨意 ServerAlias www.domain.td # www.domain.td 為項目localhost訪問的域名別名,和上面對應 ErrorLog "logs/domain.td-error.log" # 生成日志文件,文件名隨意 CustomLog "logs/domain.td-access.log" combined # 生成日志文件,文件名隨意
</VirtualHost>
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 www.domain.td
【系統環境】
win7
【問題】
設置好項目訪問的域名別名之后,打開瀏覽器訪問 www.domain.td 發現 403 Access Forbidden
【解決方法】
經過一番google之后,鎖定 \xampp\apache\conf\httpd.conf 文件,E字看着真心累啊
<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow # deny from all # 原先的默認設置 Allow from all # 改成 Allow 問題解決 </Directory>