RE: Mixing ReWrite and AliasMatch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:covener@xxxxxxxxx] 
Sent: Sunday, 2 March 2014 11:23 PM
To: users@xxxxxxxxxxxxxxxx
Subject: Re:  Mixing ReWrite and AliasMatch

On Sun, Mar 2, 2014 at 7:09 AM, Darren Ward (darrward) <darrward@xxxxxxxxx> 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-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx






[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux