Using mod_rewrite to hide tomcat port

Posted by user123181 on Server Fault See other posts from Server Fault or by user123181
Published on 2012-06-01T09:48:12Z Indexed on 2012/06/01 10:43 UTC
Read the original article Hit count: 250

Filed under:
|
|
|

I have apps on Tomcat that use URLs like this: http://xxx:8080/myapp

I don't want the users to see the port in the URL.

Hi can do a rewrite rule like this:

RewriteRule ^/myapp(.*) http://xxx:8080/myapp$1 [P,L]

This way, if a user goes to the URL http://xxx/myapp he can enter the app fine, but the port will still show up on the browser. I want the URL that the user sees to be always http://xxx/myapp

How can I do this using mod_rewrite?

© Server Fault or respective owner

Related posts about tomcat

Related posts about mod-rewrite