httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Cicimov <icici...@gmail.com>
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)" <darrward@cisco.com> 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
success.html
>
> 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
order.
> <VirtualHost 10.67.21.131>
>     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$
/www/docs/wifi-tc/library/test/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: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

Mime
View raw message