tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Turner, John" <>
Subject RE: relative URL Link question
Date Wed, 23 Oct 2002 13:32:52 GMT

If you want to go from unsecure to secure, using a URL on a web page, you
need to make it the full URL.  Otherwise, the browser will rewrite the URL
as a normal HTTP URL.

For example, if you have "page.jsp" on your page, a browser will make this
"http://yourhost/page.jsp" when rendering the page.  There is no way that I
know of to cause the browser to use "https" instead.

If you want page1.jsp to have a SSL link to page2.jsp, you need to write
that link as "https://yourhost/page2.jsp".

Incidentally, just changing the port will get you will not
get a SSL connection if you use "http://yourhost:443/page.jsp" even though
443 is the default SSL port.  Your browser does not key off of port number,
it keys off of connection type: http vs. https.  That's why you can run SSL
on 8443 for Tomcat stand-alone.  Using "http://yourhost:8443/page.jsp" will
not result in an SSL connection, but "https://yourhost:8443/page.jsp" will.

Your page URLs should always be relative, unless they are SSL.  Even then,
you only need the initial URL to be "https://yourhost/page.jsp". After that,
relative URLs like "page.jsp" will be translated to "https" by the browser
instead of "http".

So, there shouldn't be "localhost" in any of your pages, unless it is the
link transitioning from non-SSL to SSL.  Once you start an SSL session, you
should stay with the SSL session, don't flip back and forth.



> -----Original Message-----
> From: Frédéric LE MAISTRE []
> Sent: Wednesday, October 23, 2002 9:11 AM
> To: Tomcat Users List
> Subject: relative URL Link question
> Is it possible to make a link to an URL without writing
> but only /page and change the port.
> Example : you're on http://www.machin:8080
> and you want to go to the page http://www.machin:443/page.htm 
> by clicking on
> a link.
> Can this link be only /page (with some information for the port)
> I ask this because i'm currently using localhost, but in the 
> future it will
> change and i don't want to modify all the links.
> Thanks
> Fred
> --
> To unsubscribe, e-mail:   
> <>
> For additional commands, e-mail: 
> <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message