httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen Boyle <>
Subject Re: Alias works fine, AliasMatch breaks ??
Date Thu, 28 Feb 2002 10:20:17 GMT
Ryan wrote:
> I have an alias setup, like
> Alias /foo  /home/WWW-data/349
> I now need to be a little more flexible on how people reach /foo, so I'm
> trying to use AliasMatch.  But even without putting any regexp's in there,
> AliasMatch doesn't work.  I'm using
> AliasMatch /foo  /home/WWW-data/349
> When I try to pull up /foo, I get the page thats usually served from my
> default virtual host (the fist one listed in httpd.conf). Very
> strange.  Any ideas?  The docs say AliasMatch works just like Alias, except
> it allows regular expressions.  But its not working like that for me.

I rather think the docs mean AliasMatch serves the same general function
as Alias but that it uses regular expressions - I don't think you can
literally replace "Alias" with "AliasMatch". In other words, AliasMatch
*needs* regular expressions to work. If you have just:

> AliasMatch /foo  /home/WWW-data/349
then this will never match because "http://servername/foo" will be
re-directed to "http://servername/foo/" (i.e. trailing slash gets added)
which will translate to "/foo/" which won't match. So you'll get the
default server. Try going by the example in the docs and put:

> AliasMatch ^/foo(.*)  /home/WWW-data/349$1

and see what happens.


Owen Boyle.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message