2011-07-18 71 views
4

我的httpd.conf阿帕奇 - URL映射到本地路徑靜態內容

<VirtualHost *:80> 
    ... 
    DocumentRoot /home/www/static 
    ... 
    <Directory /home/www/static> 
    Order Allow,Deny 
    Allow from all 
    </Directory> 

    <Location "/foo"> 
    SetHandler None 
    </Location> 
</virtualhost> 

我在/home/www/static/foo/helloworld.txt的文件。如果我去http://localhost/foo/helloworld.txt我會看到那個文件。

現在,由於一些不相關的原因,我想改變網址。上面的網址不會返回任何內容,而http://localhost/bar/helloworld.txt應該返回文件。我想實現這一點,而不改變目錄結構中的任何內容。

這是怎麼做的?

回答