Re: Question about redirects using RewriteMatch

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

 



2009/11/19 Diego, Emil <ediego@xxxxxxxxxxxxxxxxxxxxxx>:
> There are some sections of the site that I wanted to setup aliases for so
> when you browse to www.bus.miami.edu/businessmiami/,
> www.bus.miami.edu/inthenews/ and www.bus.miami.edu/embapr/ you automatically
> get redirected to the specified page.
>
> RedirectMatch /businessmiami(/|$)
> "http://www.bus.miami.edu/news-and-media/publications/busmiami/index.html";
> RedirectMatch /inthenews(/|$)
> "http://www.bus.miami.edu/news-and-media/in-the-news/index.html";
> RedirectMatch /embapr(/|$)
> "http://www.bus.miami.edu/graduate-programs/executive-mba/emba-off-campus/puerto-rico/index.html";
>
> I encountered a problem where I had an image in a folder
> /_assets/images/businessmiami/cover.jpg.  The web page wouldn’t load the
> image because the link was getting redirected because of the RedirectMatch.
>  I’m not sure why it’s not working correctly.  Anyone have any suggestions.

I think a ^ at the beginning of your matching pattern should fix your
problem. For example:-

RedirectMatch ^/businessmiami(/*)$
"http://www.bus.miami.edu/news-and-media/publications/busmiami/index.html";

This means it only matches when /businessmiami is at the start of the
request URI and not in middle of it, as in your image link.

Cheers,
Phil.

---------------------------------------------------------------------
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



[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