Apache - Mappage d'url pour le chemin d'accès local pour le contenu statique

Mon httpd.conf

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

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

J'ai un fichier /home/www/static/foo/helloworld.txt. Et si je vais à http://localhost/foo/helloworld.txt je vais voir ce fichier.

Maintenant, pour certains pertinence raison, je veux changer l'url. L'url ci-dessus doit renvoyer rien, alors http://localhost/bar/helloworld.txt doit renvoyer le fichier. Et je veux atteindre cet objectif, sans rien changer dans la structure de répertoire.

Comment est-ce fait?

OriginalL'auteur Erik Ninn-Hansen | 2011-07-18