Forum Moderators: phranque

Message Too Old, No Replies

Does "Alias /foo/bar/" work?

I got a 404 error

         

guarriman

9:34 am on Nov 16, 2007 (gmt 0)

10+ Year Member



Hi.

Using Apache 2.0 on Linux (with 'mod_alias' loaded), I want to set an alias:
/foo1/foo2/ --> /usr/www/example/foo2/

This is part of my 'httpd.conf':
--------------------------
<VirtualHost example.com>
DocumentRoot /usr/www/example/web
ServerName example.com

Alias /foo1/foo2/ /usr/www/example/foo2/
<Directory "/usr/www/example/foo2/">
Options Indexes FollowSymLinks
Order Allow,Deny
Allow from all
AllowOverride all
DirectoryIndex index.php
</Directory>
</VirtualHost>
--------------------------

But if I access:
http://example.com/foo1/foo2/
I get a 404 error.

Any suggestion? Thank you very much.

*EDITED by guarriam for search engines*: two directories, two levels, two levels of directories

[edited by: guarriman at 9:45 am (utc) on Nov. 16, 2007]

guarriman

9:44 am on Nov 16, 2007 (gmt 0)

10+ Year Member



I've found out that my problem was another Alias directory:
-----
Alias /foo1/ /usr/www/foo1/
---------
which I placed *after* "Alias /foo1/foo2/". So Apache was looking for
/usr/www/foo1/foo2 directory.

You must place "Alias /foo1/" *BEFORE* "Alias /foo1/foo2"