Forum Moderators: phranque

Message Too Old, No Replies

On https page, how to setup the link to http page

Apache/Tomcat, https

         

jinhh

9:22 pm on Jun 7, 2006 (gmt 0)

10+ Year Member



I am working on an Apache/Tomcat web site. Tomcat and Apache are installed on the same machine (but in different directories). I set ProxyPass & ProxyPassReverse in Apache httpd file to send request to tomcat. A java application uses https for some secured pages. On these secured pages (like [mysite.com...] the header/footer have some links (like [mysite.com...] which point to the non-secured pages.

I don’t like the way these links are set, even though they work perfectly now. I hope I can use the form of /sitemap.html (such as <a href=”/sitemap.html”>), instead of a full absolute address (like <a href=”http//www.mysite.com/sitemap.html”>). It is not because it is short but because this way I don’t have to modify the code when I move the code from testing server to production. I tried the preferred format but it does not work. Apache/tomcat try to fetch https//www.mysite.com/sitemap.html but failed (because this is a wrong URL, it should be http not https).

My question is that is there any way I can configure apache and/or tomcat to let them know I want http page here not https page.

jdMorgan

10:22 pm on Jun 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want to change protocols, then using a full canonical URL is your only choice. You could look into using SSI, PHP, or any other server-side software to insert the value of the current %{SERVER_NAME} or %{HTTP_HOST} server variable in the URL, thus making the code portable.

SSI Example:


<a href=”http//<!--echo var='{HTTP_HOST}' -->/sitemap.html”>Site Map</a>

Ref: Apache mod_include [httpd.apache.org]

Jim

jinhh

1:26 pm on Jun 9, 2006 (gmt 0)

10+ Year Member



Jim:

Thank you for your comment and suggestion. I will consider that.

Jin