一般Linux Web資料放置在此目錄下/var/www/html,若此目錄下有AA及BB資料夾,那web瀏覽時就呈現 http://localhost/AA/ 及 http://localhost/BB/等狀態。 假若http://localhost/test是此狀況下,指定的實體目錄希望指向到/var/test,這就必須使用到虛擬目錄功能。
Alias /test/ "/var/test" #實體目錄 #實體目錄權限設定 <Directory "/var/test"> Order allow,deny Allow from all </Directory>
#/etc/init.d/httpd configtest Syntax OK
#/etc/init.d/httpd restart
#links http://localhost/test