Conditional alias?

Conditional alias?

am 25.09.2007 19:18:19 von richardkmiller

Can I make the alias directive conditional? I want something like
this:

AliasCond %{REQUEST_FILENAME} !-f
Alias /robots.txt /www/robots.txt

AliasCond %{REQUEST_FILENAME} !-f
Alias /favicon.ico /www/favicon.ico

I'd like to configure a default robots.txt and favicon.ico for all the
virtual hosts that do not have their own. But if a virtualhost has its
own robots.txt and favicon.ico, I'd like those to be used instead. Is
this possible?

Re: Conditional alias?

am 05.10.2007 00:55:22 von Motin

On 25 Sep, 19:18, Richard K Miller wrote:
> Can I make the alias directive conditional? I want something like
> this:
>
> AliasCond %{REQUEST_FILENAME} !-f
> Alias /robots.txt /www/robots.txt
>
> AliasCond %{REQUEST_FILENAME} !-f
> Alias /favicon.ico /www/favicon.ico
>
> I'd like to configure a default robots.txt and favicon.ico for all the
> virtual hosts that do not have their own. But if a virtualhost has its
> own robots.txt and favicon.ico, I'd like those to be used instead. Is
> this possible?

Alias directives are not read on a request-basis. You probably want a
decent RewriteRule with reelvant conditionals instead.