httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Cicimov <>
Subject Re: [users@httpd] Mixing ReWrite and AliasMatch
Date Fri, 28 Feb 2014 07:54:36 GMT
On 27/02/2014 12:23 PM, "Darren Ward (darrward)" <> wrote:
> Hi Guys
> I'm trying to combin a couple of things and I don't think it is going to
work so I'm looking for some advice please...
> Essentially I want to have a ReWrite rule that detects when an Apple
captive portal detect is perfromend and send the request to a page that
should emulate the required Success result expected
> However the same VirtualHost has to map all web requests to its root
index page
> I believe the Rewrite will rewrite as I expect but then when I hit that
last AliasMatch it would be sent the root index.html instead of the
> I then thought about putting the Rewrite at the bottom but when an
AliasMatch is met it doesn't continue searching I don't think so it would
hit the rewrite because of the last AliasMatch statement
Rewrite rewrites the url's and Alias maps url's to the file system. Hence
apache will execute mod_rewrite before mod_alias no matter of the statement
> <VirtualHost>
>     DocumentRoot   /www/docs/wifi-tc
>     RewriteEngine   on
>     RewriteCond      %{HTTP_USER_AGENT}     ^CaptiveNetworkSupport*
>     RewriteRule      ^(.*)$      /library/test/success.html [L]
>     ScriptAlias        /cgi-bin/ "/www/docs/wifi-tc/cgi-bin/"
>     AliasMatch      /perl/(.*)$     /var/www/perl/$1
>     AliasMatch     /success.html$
>     AliasMatch     ^(.*)$      /www/docs/wifi-tc/index.html
> </VirtualHost>
> Looking for some advise on how to rewrite this so that it would not
change the captive portal detect rewrite
> Darren
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message