Question about redirects using RewriteMatch

Question about redirects using RewriteMatch

am 19.11.2009 15:13:54 von ediego

--_000_C72ABCD2EC17ediegomiamiedu_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

There are some sections of the site that I wanted to setup aliases for so w=
hen you browse to www.bus.miami.edu/businessmiami/, www.bus.miami.edu/inthe=
news/ 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-t=
he-news/index.html"
RedirectMatch /embapr(/|$) "http://www.bus.miami.edu/graduate-programs/exec=
utive-mba/emba-off-campus/puerto-rico/index.html"

I encountered a problem where I had an image in a folder /_assets/images/bu=
sinessmiami/cover.jpg. The web page wouldn't load the image because the li=
nk was getting redirected because of the RedirectMatch. I'm not sure why i=
t's not working correctly. Anyone have any suggestions.

Thanks,
Emil Diego

--_000_C72ABCD2EC17ediegomiamiedu_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



Question about redirects using RewriteMatch


11pt'>There are some sections of the site that I wanted to setup aliases fo=
r 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(/|$) " /news-and-media/publications/busmiami/index.html">http://www .bus.miami.edu/=
news-and-media/publications/busmiami/index.html
"

RedirectMatch /inthenews(/|$) " s-and-media/in-the-news/index.html">http://www.bus.miami.edu /news-and-media=
/in-the-news/index.html
"

RedirectMatch /embapr(/|$) " te-programs/executive-mba/emba-off-campus/puerto-rico/index. html">http://ww=
w.bus.miami.edu/graduate-programs/executive-mba/emba-off-cam pus/puerto-rico=
/index.html
"



I encountered a problem where I had an image in a folder /_assets/images/bu=
sinessmiami/cover.jpg.  The web page wouldn’t load the image bec=
ause the link was getting redirected because of the RedirectMatch.  I&=
#8217;m not sure why it’s not working correctly.  Anyone have an=
y suggestions.



Thanks,

Emil Diego





--_000_C72ABCD2EC17ediegomiamiedu_--

Re: Question about redirects using RewriteMatch

am 19.11.2009 15:29:06 von Philip Wigg

2009/11/19 Diego, Emil :
> 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 automatica=
lly
> get redirected to the specified page.
>
> RedirectMatch /businessmiami(/|$)
> "http://www.bus.miami.edu/news-and-media/publications/busmia mi/index.html=
"
> RedirectMatch /inthenews(/|$)
> "http://www.bus.miami.edu/news-and-media/in-the-news/index.h tml"
> RedirectMatch /embapr(/|$)
> "http://www.bus.miami.edu/graduate-programs/executive-mba/em ba-off-campus=
/puerto-rico/index.html"
>
> I encountered a problem where I had an image in a folder
> /_assets/images/businessmiami/cover.jpg. =A0The web page wouldn=92t load =
the
> image because the link was getting redirected because of the RedirectMatc=
h.
> =A0I=92m not sure why it=92s not working correctly. =A0Anyone have any su=
ggestions.

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/busmia mi/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 for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Question about redirects using RewriteMatch

am 19.11.2009 15:30:02 von Tom Evans

--000e0ce0d4a0d66db30478ba3112
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 19, 2009 at 2:13 PM, Diego, Emil
wrote:

> There are some sections of the site that I wanted to setup aliases for s=
o
> 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/busmiam i/index.html"
> RedirectMatch /inthenews(/|$) "
> http://www.bus.miami.edu/news-and-media/in-the-news/index.ht ml"
> RedirectMatch /embapr(/|$) "
> http://www.bus.miami.edu/graduate-programs/executive-mba/emb a-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â€=99t l=
oad the
> image because the link was getting redirected because of the RedirectMatc=
h.
> Iâ€=99m not sure why itâ€=99s not working correctly. Anyone hav=
e any suggestions.
>
> Thanks,
> Emil Diego
>

http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect match

Your image matches the first regexp. If you mean "^/businessmiami(/|)$",
then you need to say so!

Cheers

Tom

--000e0ce0d4a0d66db30478ba3112
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 19, 2009 at 2:13 PM, Diego, Emil an dir=3D"ltr"><ediego@=
exchange.sba.miami.edu
> wrote:
quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt =
0pt 0.8ex; padding-left: 1ex;">





11pt;">There are some sections of the site that I wanted to setup aliases =
for so when you browse to /" target=3D"_blank">www.bus.miami.edu/businessmiami/, //www.bus.miami.edu/inthenews/" target=3D"_blank">www.bus.miami.edu/inthene=
ws/
and =
www.bus.miami.edu/embapr/
you automatically get redirected to the speci=
fied page.  




RedirectMatch /businessmiami(/|$) " /news-and-media/publications/busmiami/index.html" target=3D"_blank">http://=
www.bus.miami.edu/news-and-media/publications/busmiami/index .html
"=



RedirectMatch /inthenews(/|$) " s-and-media/in-the-news/index.html" target=3D"_blank">http://www.bus.miami.=
edu/news-and-media/in-the-news/index.html
"

RedirectMatch /embapr(/|$) " te-programs/executive-mba/emba-off-campus/puerto-rico/index. html" target=3D=
"_blank">http://www.bus.miami.edu/graduate-programs/executiv e-mba/emba-off-=
campus/puerto-rico/index.html
"




I encountered a problem where I had an image in a folder /_assets/images/bu=
sinessmiami/cover.jpg.  The web page wouldnâ€=99t load the image b=
ecause the link was getting redirected because of the RedirectMatch.  =
Iâ€=99m not sure why itâ€=99s not working correctly.  Anyone h=
ave any suggestions.




Thanks,

Emil Diego





alias.html#redirectmatch">http://httpd.apache.org/docs/2.2/m od/mod_alias.ht=
ml#redirectmatch


Your image matches the first regexp. If you mea=
n "^/businessmiami(/|)$", then you need to say so!


Cheers

Tom


--000e0ce0d4a0d66db30478ba3112--