You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alexander Diedler <ad...@tecracer.de> on 2009/04/27 11:02:47 UTC

Permanent Redirect?

Hello everybody,

I have a question to implement a permanent redirect for an old domain to a
new domain on the Tomcat 6.0.16 Server.

It is definied in the server.xml as it own connector (for SSL) and now we
want, that if we fill-in www.websiteA.de we will be redirected to
www.websiteB.de automatically.

 

Greetings

Alexander

 


RE: AW: Permanent Redirect?

Posted by Martin Gainty <mg...@hotmail.com>.
Alex-

you can use tuckey to rewrite the URL to redirect to your SSL enabled site
http://tuckey.org/urlrewrite

any ContextPath of / will direct to ROOT.war for that Tomcat
http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html

Viel Gluck/Good Luck
Martin 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.






> From: adiedler@tecracer.de
> To: users@tomcat.apache.org
> Date: Mon, 27 Apr 2009 13:59:02 +0200
> Subject: AW: Permanent Redirect?
> 
> I think the ways seems to be right. 
> It has to be a safe procedure, that a
> http://www.websiteA.de/index.cfm?uuid=230942iwpofiswfksdsdf has to be
> redirected with the same URL Parameters to the
> http://www.websiteB.de/index.cfm?uuid=230942iwpofiswfksdsdf in Tomcat. We
> have to implement a new SSL Certificate with the new Domain, that is already
> known.
> 
> Greetings
> Alexander
> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
> Gesendet: Montag, 27. April 2009 11:14
> An: Tomcat Users List
> Betreff: RE: Permanent Redirect?
> 
> > From: Pid [mailto:p@pidster.com]
> > Subject: Re: Permanent Redirect?
> > 
> > A small webapp deployed in websiteA.de/ROOT that contains a servlet
> > Filter which is coded to issue an appropriate redirect to the new URL.
> 
> Since this is over SSL, will there be certificate problems in trying to do
> the above?
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Rediscover Hotmail®: Get e-mail storage that grows with you. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009

AW: Permanent Redirect?

Posted by Alexander Diedler <ad...@tecracer.de>.
I think the ways seems to be right. 
It has to be a safe procedure, that a
http://www.websiteA.de/index.cfm?uuid=230942iwpofiswfksdsdf has to be
redirected with the same URL Parameters to the
http://www.websiteB.de/index.cfm?uuid=230942iwpofiswfksdsdf in Tomcat. We
have to implement a new SSL Certificate with the new Domain, that is already
known.

Greetings
Alexander



-----Ursprüngliche Nachricht-----
Von: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Gesendet: Montag, 27. April 2009 11:14
An: Tomcat Users List
Betreff: RE: Permanent Redirect?

> From: Pid [mailto:p@pidster.com]
> Subject: Re: Permanent Redirect?
> 
> A small webapp deployed in websiteA.de/ROOT that contains a servlet
> Filter which is coded to issue an appropriate redirect to the new URL.

Since this is over SSL, will there be certificate problems in trying to do
the above?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Permanent Redirect?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Pid [mailto:p@pidster.com]
> Subject: Re: Permanent Redirect?
> 
> A small webapp deployed in websiteA.de/ROOT that contains a servlet
> Filter which is coded to issue an appropriate redirect to the new URL.

Since this is over SSL, will there be certificate problems in trying to do the above?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: AW: AW: Permanent Redirect?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander,

On 5/11/2009 4:56 AM, Alexander Diedler wrote:
> Yes it works with Tuckey.org but, what about http and https?
> In my urlrewrite.xml only this entry:
> <urlrewrite>
>    <rule>
>        <from>/(.*)$</from>
>        <to type="redirect">http://www.thenewserver.de/$1</to>
>     </rule>
> </urlrewrite>
> 
> But if the user came from https he should also redirected to
> https://thenewserver.de/?someparameters

RTFM

<condition type="scheme" value="https" />
vs.
<condition type="scheme" value="http" />

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkoIR88ACgkQ9CaO5/Lv0PCt7ACfahPXAzDjEuKIgXZMH42aELyQ
jnAAnjvMqaYsMFE2kXclOwC+B3dGovdy
=8MKo
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


AW: AW: Permanent Redirect?

Posted by Alexander Diedler <ad...@tecracer.de>.
Hello,
Yes it works with Tuckey.org but, what about http and https?
In my urlrewrite.xml only this entry:
<urlrewrite>
   <rule>
       <from>/(.*)$</from>
       <to type="redirect">http://www.thenewserver.de/$1</to>
    </rule>
</urlrewrite>

But if the user came from https he should also redirected to
https://thenewserver.de/?someparameters


Greetings
Alexander


-----Ursprüngliche Nachricht-----
Von: Pid [mailto:p@pidster.com] 
Gesendet: Donnerstag, 30. April 2009 11:51
An: Tomcat Users List
Betreff: Re: AW: Permanent Redirect?

Alexander Diedler wrote:
> Hmm..
> Seems not to be work for me.... The target is a
http://www.siteA.de/index.jsp?WERWERWERWERWER redirect to
http://www.siteB.de/index.jsp?WERWERWERWERWER
> I download the package, unzip and put the new content to a new, empty
docBase folder. I edit my ROOT.xml in SiteA point to this new folder and
create an empty web.xml that contains only 
>   <filter>
>            <filter-name>UrlRewriteFilter</filter-name>
>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-cla
ss>
>         </filter>
>         <filter-mapping>
>            <filter-name>UrlRewriteFilter</filter-name>
>            <url-pattern>/*</url-pattern>
>         </filter-mapping>
> 
> But where I have to define, what is the target of the redirect?

Have you read: http://tuckey.org/urlrewrite/manual/3.0/

p


> My Tomcat:
> [tomcat-base]/conf/Catalina/www.siteA.de/ROOT.xml  (Context docBase point
to D:\Inetpub\SiteA)
> [tomcat-base]/conf/Catalina/www.siteB.de/ROOT.xml  (Context docBase point
to D:\Inetpub\SiteA)
> [tomcat-base]/conf/Catalina/www.siteC.de/ROOT.xml  (Context docBase point
to D:\Inetpub\SiteA)
> 
> Same DocBase because it is a CMS with the functionality to show different
content for different domains.
> Server.xml:
> <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>            port="443" address="xxx.xxx.xxx.209" addressminSpareThreads="5"
maxSpareThreads="75"
>            enableLookups="true" disableUploadTimeout="true" 
>            acceptCount="100"  maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="D:/Keystore/siteA.kdb" keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
> 
> 	 <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>            port="443" address="xxx.xxx.xxx.210" addressminSpareThreads="5"
maxSpareThreads="75"
>            enableLookups="true" disableUploadTimeout="true" 
>            acceptCount="100"  maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="D:/Keystore/siteB.kdb" keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
> 
> 	 <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>            port="443" address="xxx.xxx.xxx.211" addressminSpareThreads="5"
maxSpareThreads="75"
>            enableLookups="true" disableUploadTimeout="true" 
>            acceptCount="100"  maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="D:/Keystore/www_siteC.kdb"
keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
> 
> If this is a very bad configuration, I am open for any better suggestions
of you...
> 
> Greetings
> Alexander Diedler
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Pid [mailto:p@pidster.com] 
> Gesendet: Montag, 27. April 2009 11:11
> An: Tomcat Users List
> Betreff: Re: Permanent Redirect?
> 
> Alexander Diedler wrote:
>> Hello everybody,
>>
>> I have a question to implement a permanent redirect for an old domain to
>> a new domain on the Tomcat 6.0.16 Server.
>>
>> It is definied in the server.xml as it own connector (for SSL) and now
>> we want, that if we fill-in www.websiteA.de <http://www.websiteA.de> we
>> will be redirected to www.websiteB.de <http://www.websiteB.de>
>> automatically.
> 
> A small webapp deployed in websiteA.de/ROOT that contains a servlet
> Filter which is coded to issue an appropriate redirect to the new URL.
> 
> You could avoid rolling your own and try: tuckey.org/urlrewrite/
> 
> p
> 
> 
>> Greetings
>>
>> Alexander
>>
>>  
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: AW: AW: Permanent Redirect?

Posted by Pid <p...@pidster.com>.
Alexander Diedler wrote:
> Sure, but I found only a solution to redirect folders on the same domain,
> but not to rewrite/redirect a complete domain with URL parameters.

In that case, perhaps this filter isn't what you need. YMMV.
It would be trivial to write a filter that executes a redirect of the
sort you need wouldn't it?

public void doFilter(ServletRequest req, ServletResponse res,
FilterChain chain) throws IOException, ServletException {
        //
	HttpServletRequest hreq = (HttpServletRequest) req;
        HttpServletResponse hres = (HttpServletResponse) res;

	String path = hreq.getRequestURI();
	String query = hreq.getQueryString();

	String newServer = "new.yourserver.com";
	
	hres.sendRedirect("http://" + newServer + path "?" + query);
}

(Use of reply-to-all should be banned.  Please just reply to the list so
I don't get two answers every time.)

p


> -----Ursprüngliche Nachricht-----
> Von: Pid [mailto:p@pidster.com] 
> Gesendet: Donnerstag, 30. April 2009 11:51
> An: Tomcat Users List
> Betreff: Re: AW: Permanent Redirect?
> 
> Alexander Diedler wrote:
>> Hmm..
>> Seems not to be work for me.... The target is a
> http://www.siteA.de/index.jsp?WERWERWERWERWER redirect to
> http://www.siteB.de/index.jsp?WERWERWERWERWER
>> I download the package, unzip and put the new content to a new, empty
> docBase folder. I edit my ROOT.xml in SiteA point to this new folder and
> create an empty web.xml that contains only 
>>   <filter>
>>            <filter-name>UrlRewriteFilter</filter-name>
>>
> <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-cla
> ss>
>>         </filter>
>>         <filter-mapping>
>>            <filter-name>UrlRewriteFilter</filter-name>
>>            <url-pattern>/*</url-pattern>
>>         </filter-mapping>
>>
>> But where I have to define, what is the target of the redirect?
> 
> Have you read: http://tuckey.org/urlrewrite/manual/3.0/
> 
> p
> 
> 
>> My Tomcat:
>> [tomcat-base]/conf/Catalina/www.siteA.de/ROOT.xml  (Context docBase point
> to D:\Inetpub\SiteA)
>> [tomcat-base]/conf/Catalina/www.siteB.de/ROOT.xml  (Context docBase point
> to D:\Inetpub\SiteA)
>> [tomcat-base]/conf/Catalina/www.siteC.de/ROOT.xml  (Context docBase point
> to D:\Inetpub\SiteA)
>> Same DocBase because it is a CMS with the functionality to show different
> content for different domains.
>> Server.xml:
>> <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>>            port="443" address="xxx.xxx.xxx.209" addressminSpareThreads="5"
> maxSpareThreads="75"
>>            enableLookups="true" disableUploadTimeout="true" 
>>            acceptCount="100"  maxThreads="200"
>>            scheme="https" secure="true" SSLEnabled="true"
>>            keystoreFile="D:/Keystore/siteA.kdb" keystorePass="changeit"
>>            clientAuth="false" sslProtocol="TLS"/>
>>
>> 	 <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>>            port="443" address="xxx.xxx.xxx.210" addressminSpareThreads="5"
> maxSpareThreads="75"
>>            enableLookups="true" disableUploadTimeout="true" 
>>            acceptCount="100"  maxThreads="200"
>>            scheme="https" secure="true" SSLEnabled="true"
>>            keystoreFile="D:/Keystore/siteB.kdb" keystorePass="changeit"
>>            clientAuth="false" sslProtocol="TLS"/>
>>
>> 	 <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>>            port="443" address="xxx.xxx.xxx.211" addressminSpareThreads="5"
> maxSpareThreads="75"
>>            enableLookups="true" disableUploadTimeout="true" 
>>            acceptCount="100"  maxThreads="200"
>>            scheme="https" secure="true" SSLEnabled="true"
>>            keystoreFile="D:/Keystore/www_siteC.kdb"
> keystorePass="changeit"
>>            clientAuth="false" sslProtocol="TLS"/>
>>
>> If this is a very bad configuration, I am open for any better suggestions
> of you...
>> Greetings
>> Alexander Diedler
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Pid [mailto:p@pidster.com] 
>> Gesendet: Montag, 27. April 2009 11:11
>> An: Tomcat Users List
>> Betreff: Re: Permanent Redirect?
>>
>> Alexander Diedler wrote:
>>> Hello everybody,
>>>
>>> I have a question to implement a permanent redirect for an old domain to
>>> a new domain on the Tomcat 6.0.16 Server.
>>>
>>> It is definied in the server.xml as it own connector (for SSL) and now
>>> we want, that if we fill-in www.websiteA.de <http://www.websiteA.de> we
>>> will be redirected to www.websiteB.de <http://www.websiteB.de>
>>> automatically.
>> A small webapp deployed in websiteA.de/ROOT that contains a servlet
>> Filter which is coded to issue an appropriate redirect to the new URL.
>>
>> You could avoid rolling your own and try: tuckey.org/urlrewrite/
>>
>> p
>>
>>
>>> Greetings
>>>
>>> Alexander
>>>
>>>  
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: AW: AW: Permanent Redirect?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

André,

On 4/30/2009 8:33 AM, André Warnier wrote:
> At the risk of stating the obvious :
> There are two different types of redirect :
> - an "internal redirect" consists of just modifying the request URL, and
> recycling the request internally from the beginning.

This is actually called a "forward", and is often confused with a
"redirect" by lots of people. The request is /not/ "recycled" or even
started-over. It is actually re-delegated (if such a term exists). If
you write a filter that performs 5 forwards and then throws an
exception, you'll see a stack trace that looks something like this:

java.lang.Exception: Intentionally-thrown exception
at my.Filter.doFilter
at RequestDispatcher.forward
at my.Filter.doFilter
at RequestDispatcher.forward
at my.Filter.doFilter
at RequestDispatcher.forward
at my.Filter.doFilter
at RequestDispatcher.forward
at my.Filter.doFilter
...

Forwarding a request is actually a method call, not a reset of the
request. This is important to understand because it has certain
implications on the nature of the request and response objects. For one,
it means you can /wrap/ a request and/or response with some other object
in order to alter the behavior of the resources targeted with the forward.

> - an "external redirect" means that the server sends a 301/302 HTTP
> response to the browser, telling it (in another HTTP header) "and here
> is the URL that you should try instead".
> (in that case it is a complete URL, http://hostname included)

This is really the only operation actually called "redirect".

> Just to make sure that you read the documentation of URLrewriteFilter
> properly, and did not miss something. Maybe they are named differently
> in the documentation ?

Of course urlrewrite provides a way to redirect.
See
http://urlrewritefilter.googlecode.com/svn/trunk/src/doc/manual/3.2/index.html#to

Specifically, you set 'type="redirect"' which results in the filter
executing a HttpServletResponse.sendRedirect(). Even better, the OP
should use type="permanent-redirect" as it will sent a 301 response.

Technically speaking, a redirect should have a complete URL (including
protocol) in it, but the example shown in the user manual lacks it:

        <rule>
           <from>^/some/olddir/(.*)$</from>
           <to type="redirect">/very/newdir/$1</to>
        </rule>

To do a redirect to another site, just fully-qualify the URL:

        <rule>
           <from>^(.*)$</from>
           <to type="redirect">http://www.siteB.de$1</to>
        </rule>

Honestly, I haven't actually /tried/ this, but the documentation
suggests that it will work. I would have tried this technique before
posting back to the list (or asking a question on the surely-helpful
user group for urlrewrite: http://groups-beta.google.com/group/urlrewrite).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkn6AQoACgkQ9CaO5/Lv0PCNkQCgpYZwaTjDMBvpFMPiTd//koyL
1iYAn20m18UCZUArWpHUfP5mrIrBAhzu
=dTat
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: AW: AW: Permanent Redirect?

Posted by André Warnier <aw...@ice-sa.com>.
Alexander Diedler wrote:
> Sure, but I found only a solution to redirect folders on the same domain,
> but not to rewrite/redirect a complete domain with URL parameters.
> 
At the risk of stating the obvious :
There are two different types of redirect :
- an "internal redirect" consists of just modifying the request URL, and 
recycling the request internally from the beginning.
(in that case of course there is not scheme://host, because it is the 
same one)

- an "external redirect" means that the server sends a 301/302 HTTP 
response to the browser, telling it (in another HTTP header) "and here 
is the URL that you should try instead".
(in that case it is a complete URL, http://hostname included)

Just to make sure that you read the documentation of URLrewriteFilter 
properly, and did not miss something. Maybe they are named differently 
in the documentation ?
It would surprise me if URLRewriteFilter did not have a way to send a 
shortcut response to the browser with a redirect header.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


AW: AW: Permanent Redirect?

Posted by Alexander Diedler <ad...@tecracer.de>.
Sure, but I found only a solution to redirect folders on the same domain,
but not to rewrite/redirect a complete domain with URL parameters.


-----Ursprüngliche Nachricht-----
Von: Pid [mailto:p@pidster.com] 
Gesendet: Donnerstag, 30. April 2009 11:51
An: Tomcat Users List
Betreff: Re: AW: Permanent Redirect?

Alexander Diedler wrote:
> Hmm..
> Seems not to be work for me.... The target is a
http://www.siteA.de/index.jsp?WERWERWERWERWER redirect to
http://www.siteB.de/index.jsp?WERWERWERWERWER
> I download the package, unzip and put the new content to a new, empty
docBase folder. I edit my ROOT.xml in SiteA point to this new folder and
create an empty web.xml that contains only 
>   <filter>
>            <filter-name>UrlRewriteFilter</filter-name>
>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-cla
ss>
>         </filter>
>         <filter-mapping>
>            <filter-name>UrlRewriteFilter</filter-name>
>            <url-pattern>/*</url-pattern>
>         </filter-mapping>
> 
> But where I have to define, what is the target of the redirect?

Have you read: http://tuckey.org/urlrewrite/manual/3.0/

p


> My Tomcat:
> [tomcat-base]/conf/Catalina/www.siteA.de/ROOT.xml  (Context docBase point
to D:\Inetpub\SiteA)
> [tomcat-base]/conf/Catalina/www.siteB.de/ROOT.xml  (Context docBase point
to D:\Inetpub\SiteA)
> [tomcat-base]/conf/Catalina/www.siteC.de/ROOT.xml  (Context docBase point
to D:\Inetpub\SiteA)
> 
> Same DocBase because it is a CMS with the functionality to show different
content for different domains.
> Server.xml:
> <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>            port="443" address="xxx.xxx.xxx.209" addressminSpareThreads="5"
maxSpareThreads="75"
>            enableLookups="true" disableUploadTimeout="true" 
>            acceptCount="100"  maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="D:/Keystore/siteA.kdb" keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
> 
> 	 <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>            port="443" address="xxx.xxx.xxx.210" addressminSpareThreads="5"
maxSpareThreads="75"
>            enableLookups="true" disableUploadTimeout="true" 
>            acceptCount="100"  maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="D:/Keystore/siteB.kdb" keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
> 
> 	 <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>            port="443" address="xxx.xxx.xxx.211" addressminSpareThreads="5"
maxSpareThreads="75"
>            enableLookups="true" disableUploadTimeout="true" 
>            acceptCount="100"  maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="D:/Keystore/www_siteC.kdb"
keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
> 
> If this is a very bad configuration, I am open for any better suggestions
of you...
> 
> Greetings
> Alexander Diedler
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Pid [mailto:p@pidster.com] 
> Gesendet: Montag, 27. April 2009 11:11
> An: Tomcat Users List
> Betreff: Re: Permanent Redirect?
> 
> Alexander Diedler wrote:
>> Hello everybody,
>>
>> I have a question to implement a permanent redirect for an old domain to
>> a new domain on the Tomcat 6.0.16 Server.
>>
>> It is definied in the server.xml as it own connector (for SSL) and now
>> we want, that if we fill-in www.websiteA.de <http://www.websiteA.de> we
>> will be redirected to www.websiteB.de <http://www.websiteB.de>
>> automatically.
> 
> A small webapp deployed in websiteA.de/ROOT that contains a servlet
> Filter which is coded to issue an appropriate redirect to the new URL.
> 
> You could avoid rolling your own and try: tuckey.org/urlrewrite/
> 
> p
> 
> 
>> Greetings
>>
>> Alexander
>>
>>  
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: AW: Permanent Redirect?

Posted by Pid <p...@pidster.com>.
Alexander Diedler wrote:
> Hmm..
> Seems not to be work for me.... The target is a http://www.siteA.de/index.jsp?WERWERWERWERWER redirect to http://www.siteB.de/index.jsp?WERWERWERWERWER
> I download the package, unzip and put the new content to a new, empty docBase folder. I edit my ROOT.xml in SiteA point to this new folder and create an empty web.xml that contains only 
>   <filter>
>            <filter-name>UrlRewriteFilter</filter-name>
>            <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
>         </filter>
>         <filter-mapping>
>            <filter-name>UrlRewriteFilter</filter-name>
>            <url-pattern>/*</url-pattern>
>         </filter-mapping>
> 
> But where I have to define, what is the target of the redirect?

Have you read: http://tuckey.org/urlrewrite/manual/3.0/

p


> My Tomcat:
> [tomcat-base]/conf/Catalina/www.siteA.de/ROOT.xml  (Context docBase point to D:\Inetpub\SiteA)
> [tomcat-base]/conf/Catalina/www.siteB.de/ROOT.xml  (Context docBase point to D:\Inetpub\SiteA)
> [tomcat-base]/conf/Catalina/www.siteC.de/ROOT.xml  (Context docBase point to D:\Inetpub\SiteA)
> 
> Same DocBase because it is a CMS with the functionality to show different content for different domains.
> Server.xml:
> <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>            port="443" address="xxx.xxx.xxx.209" addressminSpareThreads="5" maxSpareThreads="75"
>            enableLookups="true" disableUploadTimeout="true" 
>            acceptCount="100"  maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="D:/Keystore/siteA.kdb" keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
> 
> 	 <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>            port="443" address="xxx.xxx.xxx.210" addressminSpareThreads="5" maxSpareThreads="75"
>            enableLookups="true" disableUploadTimeout="true" 
>            acceptCount="100"  maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="D:/Keystore/siteB.kdb" keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
> 
> 	 <Connector protocol="org.apache.coyote.http11.Http11Protocol"
>            port="443" address="xxx.xxx.xxx.211" addressminSpareThreads="5" maxSpareThreads="75"
>            enableLookups="true" disableUploadTimeout="true" 
>            acceptCount="100"  maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="D:/Keystore/www_siteC.kdb" keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
> 
> If this is a very bad configuration, I am open for any better suggestions of you...
> 
> Greetings
> Alexander Diedler
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Pid [mailto:p@pidster.com] 
> Gesendet: Montag, 27. April 2009 11:11
> An: Tomcat Users List
> Betreff: Re: Permanent Redirect?
> 
> Alexander Diedler wrote:
>> Hello everybody,
>>
>> I have a question to implement a permanent redirect for an old domain to
>> a new domain on the Tomcat 6.0.16 Server.
>>
>> It is definied in the server.xml as it own connector (for SSL) and now
>> we want, that if we fill-in www.websiteA.de <http://www.websiteA.de> we
>> will be redirected to www.websiteB.de <http://www.websiteB.de>
>> automatically.
> 
> A small webapp deployed in websiteA.de/ROOT that contains a servlet
> Filter which is coded to issue an appropriate redirect to the new URL.
> 
> You could avoid rolling your own and try: tuckey.org/urlrewrite/
> 
> p
> 
> 
>> Greetings
>>
>> Alexander
>>
>>  
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


AW: Permanent Redirect?

Posted by Alexander Diedler <ad...@tecracer.de>.
Hmm..
Seems not to be work for me.... The target is a http://www.siteA.de/index.jsp?WERWERWERWERWER redirect to http://www.siteB.de/index.jsp?WERWERWERWERWER
I download the package, unzip and put the new content to a new, empty docBase folder. I edit my ROOT.xml in SiteA point to this new folder and create an empty web.xml that contains only 
  <filter>
           <filter-name>UrlRewriteFilter</filter-name>
           <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
        </filter>
        <filter-mapping>
           <filter-name>UrlRewriteFilter</filter-name>
           <url-pattern>/*</url-pattern>
        </filter-mapping>

But where I have to define, what is the target of the redirect?

My Tomcat:
[tomcat-base]/conf/Catalina/www.siteA.de/ROOT.xml  (Context docBase point to D:\Inetpub\SiteA)
[tomcat-base]/conf/Catalina/www.siteB.de/ROOT.xml  (Context docBase point to D:\Inetpub\SiteA)
[tomcat-base]/conf/Catalina/www.siteC.de/ROOT.xml  (Context docBase point to D:\Inetpub\SiteA)

Same DocBase because it is a CMS with the functionality to show different content for different domains.
Server.xml:
<Connector protocol="org.apache.coyote.http11.Http11Protocol"
           port="443" address="xxx.xxx.xxx.209" addressminSpareThreads="5" maxSpareThreads="75"
           enableLookups="true" disableUploadTimeout="true" 
           acceptCount="100"  maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           keystoreFile="D:/Keystore/siteA.kdb" keystorePass="changeit"
           clientAuth="false" sslProtocol="TLS"/>

	 <Connector protocol="org.apache.coyote.http11.Http11Protocol"
           port="443" address="xxx.xxx.xxx.210" addressminSpareThreads="5" maxSpareThreads="75"
           enableLookups="true" disableUploadTimeout="true" 
           acceptCount="100"  maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           keystoreFile="D:/Keystore/siteB.kdb" keystorePass="changeit"
           clientAuth="false" sslProtocol="TLS"/>

	 <Connector protocol="org.apache.coyote.http11.Http11Protocol"
           port="443" address="xxx.xxx.xxx.211" addressminSpareThreads="5" maxSpareThreads="75"
           enableLookups="true" disableUploadTimeout="true" 
           acceptCount="100"  maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           keystoreFile="D:/Keystore/www_siteC.kdb" keystorePass="changeit"
           clientAuth="false" sslProtocol="TLS"/>

If this is a very bad configuration, I am open for any better suggestions of you...

Greetings
Alexander Diedler


-----Ursprüngliche Nachricht-----
Von: Pid [mailto:p@pidster.com] 
Gesendet: Montag, 27. April 2009 11:11
An: Tomcat Users List
Betreff: Re: Permanent Redirect?

Alexander Diedler wrote:
> Hello everybody,
> 
> I have a question to implement a permanent redirect for an old domain to
> a new domain on the Tomcat 6.0.16 Server.
> 
> It is definied in the server.xml as it own connector (for SSL) and now
> we want, that if we fill-in www.websiteA.de <http://www.websiteA.de> we
> will be redirected to www.websiteB.de <http://www.websiteB.de>
> automatically.

A small webapp deployed in websiteA.de/ROOT that contains a servlet
Filter which is coded to issue an appropriate redirect to the new URL.

You could avoid rolling your own and try: tuckey.org/urlrewrite/

p


> Greetings
> 
> Alexander
> 
>  
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Permanent Redirect?

Posted by Pid <p...@pidster.com>.
Alexander Diedler wrote:
> Hello everybody,
> 
> I have a question to implement a permanent redirect for an old domain to
> a new domain on the Tomcat 6.0.16 Server.
> 
> It is definied in the server.xml as it own connector (for SSL) and now
> we want, that if we fill-in www.websiteA.de <http://www.websiteA.de> we
> will be redirected to www.websiteB.de <http://www.websiteB.de>
> automatically.

A small webapp deployed in websiteA.de/ROOT that contains a servlet
Filter which is coded to issue an appropriate redirect to the new URL.

You could avoid rolling your own and try: tuckey.org/urlrewrite/

p


> Greetings
> 
> Alexander
> 
>  
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org