Thanks

Still can't get this string to be matched though

    RewriteCond %{HTTP_USER_AGENT} ^CaptiveNetworkSupport*
    RewriteRule ^(.*)$ /library/test/success.html [PT]

Isn't matching:

wifi-tc:192.168.104.39 - - [28/Feb/2014:11:02:42 +1100] "GET 
/ah66Mlma/GwaqQ1ka.html HTTP/1.0" 200 334 "-" "CaptiveNetworkSupport-277 wispr"
wifi-tc:192.168.104.39 - - [28/Feb/2014:11:15:08 +1100] "GET 
/NLHHvH2Y/Z4CXHCDW/Q9VhrIWd/x3O3upE2.html HTTP/1.0" 200 334 "-" 
"CaptiveNetworkSupport-277 wispr"

Logic seems ok and the regex is a simple one...

Darren

-----Original Message-----
From: Eric Covener [mailto:cove...@gmail.com] 
Sent: Sunday, 2 March 2014 11:23 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Mixing ReWrite and AliasMatch

On Sun, Mar 2, 2014 at 7:09 AM, Darren Ward (darrward) <darrw...@cisco.com> 
wrote:
> Thanks Igor
>
> So in my example if I see a UserAgent starting with 
> CaptiveNetworkSupport then I should rewrite the URL to 
> http://originalhost/library/test/success.html
>
> THEN the AliasMatch ending in /success.html should then map the 
> request to the local file
>
> Is that correct?

You'll need the [PT] flag if you want the Alias to be based off of your rewrite.

>
> If so doesn't seem to be working as I can see UserAgent matching the 
> RewriteCond in the logfile:
>
> wifi-tc:192.168.104.39 - - [28/Feb/2014:11:02:42 +1100] "GET 
> /ah66Mlma/GwaqQ1ka.html HTTP/1.0" 200 334 "-" "CaptiveNetworkSupport-277 
> wispr"
> wifi-tc:192.168.104.39 - - [28/Feb/2014:11:15:08 +1100] "GET 
> /NLHHvH2Y/Z4CXHCDW/Q9VhrIWd/x3O3upE2.html HTTP/1.0" 200 334 "-" 
> "CaptiveNetworkSupport-277 wispr"
>
> I added:
>
>     RewriteLog logs/wifi-tc-rewrite
>

> But it's always a zero length file with no hits (restarted Apache of 
> course)

RewriteLogLevel 9? And make sure they're set in the vhost handling the request.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to