Liferay ist zum sechsten Mal in Folge ein Leader im Gartner Magic Quadrant. Hier mehr erfahren

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Brian Scott Schupbach
Forward URL using urlrewrite.xml
16. Juli 2012 09:14
Antwort

Brian Scott Schupbach

Rang: Expert

Nachrichten: 329

Eintrittsdatum: 23. Oktober 2008

Neue Beiträge

Hello,

I have two URLs. One is .com the other is .org. I would like to forward .com to the .org URL. I am using tomcat without apache in front of it. So, I believe I need to do this using the urlrewrite.xml file. However, it isn't working. Can someone please help? I am at a loss and we need this done ASAP.

Thanks!!

<?xml version="1.0"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 2.6//EN" "http://tuckey.org/res/dtds/urlrewrite2.6.dtd">

<urlrewrite>
<rule>
<from>(.*)/blog/blogs/rss(.*)</from>
<to type="permanent-redirect">$1/blog/-/blogs/rss$2</to>
</rule>
<rule>
<from>(.*)/-/blogs/rss\?&amp;(.*)</from>
<to type="permanent-redirect">$1/-/blogs/rss\?$2</to>
</rule>
<rule>
<from>^/c/journal/view_article_content\?groupId=14&amp;articleId=155291$</from>
<to type="permanent-redirect">/web/guest/home/-/journal/rss/14/news</to>
</rule>
<rule>
<from>(.*)/tunnel-web(.*)</from>
<to type="permanent-redirect">$1/api$2</to>
</rule>
<rule>
<from>^/web/guest/community/forums/message_boards(.*)$</from>
<to type="permanent-redirect">/web/guest/community/forums/-/message_boards$1</to>
</rule>
<rule>
<from>^/web/guest/home/journal/rss/14/news$</from>
<to type="permanent-redirect">/web/guest/home/-/journal/rss/14/news</to>
</rule>
<rule>
<from>http://huskeralum.com</from>
<to type="forward">http://huskeralum.org/home</to>
</rule>
</urlrewrite>
Brian Scott Schupbach
RE: Forward URL using urlrewrite.xml
23. Juli 2012 14:37
Antwort

Brian Scott Schupbach

Rang: Expert

Nachrichten: 329

Eintrittsdatum: 23. Oktober 2008

Neue Beiträge

Update:

Use a web server like apache or IIS in front of tomcat if you need to do a lot of URL redirection. It's much easier..
Orin Fink
RE: Forward URL using urlrewrite.xml
5. November 2012 05:26
Antwort

Orin Fink

Rang: Junior Member

Nachrichten: 43

Eintrittsdatum: 24. März 2010

Neue Beiträge

As an FYI, the rule that you added wasn't correct. The hostname is usually a condition, even w/ Apache style redirects. For example, you may have tried the format of the rule as discussed here (with representation of how it correlates to a similar apache style rule.

http://urlrewritefilter.googlecode.com/svn/trunk/src/doc/manual/4.0/guide.html#mod_re
Brian Scott Schupbach
RE: Forward URL using urlrewrite.xml
29. August 2012 11:58
Antwort

Brian Scott Schupbach

Rang: Expert

Nachrichten: 329

Eintrittsdatum: 23. Oktober 2008

Neue Beiträge

Thanks! I guess that makes sense as to why it wasn't working..

We ended up deciding to use IIS in front of tomcat. After we had that going setting up redirects wasn't too complicated.