4

Some applications (such as Plone) default to serving http on ports other than 80 (eg 8080).

Typically, to view those webapps you need to load http://mysite.tld:8080 instead of just http://mysite.tld (presuming you also have a 'standard' website running on port 80).

Is there a way to disguise and/or hide the port number from showing up in the address bar so that visitors don't know they're not on the standard http port? If so, how? Is a URL rewrite the proper approach?

warren
  • 18,369
  • 23
  • 84
  • 135
  • What is the application for this? – mdpc Jan 17 '12 at 23:27
  • @mdpc - as mentioned above, if you want to run Apache and Plone (for example) on the same machine, one will be on port 80 while the other is on 8080. To a visitor, it would be nice to not show that they're hitting a different application via the visual cue of the port number in the URL bar. – warren Jan 17 '12 at 23:28
  • Not an answer, but your statement: > Typically, to view those webapps you need to load http://mysite.tld:8080 instead of just http://mysite.tld (presuming you also have a 'standard' website running on port 80). Isn't correct. Regardless of whether or not you have a site running on port 80, if your site runs on port 8080 the client browser will not get there unless they specify the port (barring any redirection on the server side). – joeqwerty Jan 18 '12 at 03:07
  • @joeqwerty - that is precisely my question :) – warren Jan 23 '12 at 17:19

4 Answers4

21

One may set up a sort of portal using Apache with mod_proxy on :80 and make it to proxy requests for anything:anywhere.

yrk
  • 2,487
  • 17
  • 22
20

Is there a way to disguise and/or hide the port number from showing up in the address bar so that visitors don't know they're not on the standard http port?

No, and there shouldn't be. Leaving a mechanism for sites to "hide" anything in the URL bar would be very bad on multiple fronts.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • 1
    Eh, you can change the file path portion of the URL from Javascript quite easily. You are correct about the server part however, especially ports above 1023. – Chris S Jan 17 '12 at 23:31
3

A somewhat rudimentary solution I have seen used to hide URLs is to host an html page with your "pretty" URL that is a single frame frameset that contains your "ugly" URL.

2

Use separate virtualhosts in Apache, one for regular Apache serving and the other for proxying Plone. With Plone this is a quite normal approach, a lot of people run Apache with mod_cache or a reverse proxy like Varnish in front of Plone.

mikkoko
  • 243
  • 2
  • 11