Re: Rewrite rule rewriting unexpectedly

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

 



On Mon, Apr 19, 2010 at 5:59 PM, Eric Covener <covener@xxxxxxxxx> wrote:
On Mon, Apr 19, 2010 at 5:44 PM, Glenn Gillis <glenn@xxxxxxxx> wrote:
> Would any rewriting gurus out there care to speculate why the rewrite rule:
>
>  "RewriteRule /blog http://spotlight.wordpress.com/"
>
> would cause the image URL:
>
>  "<img src=""> >  alt="what we do" width="500" height="125" />"
>
> to redirect to the spotlight.wordpress.com webpage?
>
> Running Apache 2.2.9 on FreeBSD 6.x.

If you want to match exactly "/blog" and not that string inside the
URL, you need to anchor it with e.g. ^/blog$

--
Eric Covener
covener@xxxxxxxxx

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


because!  regular expressions are by definition greedy, which means they will match the largest possible string of characters.  If you don't give it boundaries like the start and end string delimiters it just sucks up everything that it can.

[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