-   Linux - Server (
-   -   apache rewrite port based on URL.. can it? (

sir-lancealot 05-12-2009 09:01 AM

apache rewrite port based on URL.. can it?
Not really sure how to title it, but we have a webserver and one of the developers is using glassfish. It's listening on port 8080, apache on the default 80.

Right now I can goto; and get my response from glassfish.

He wants to have apache listen for 'folder' and send that to glassfish without the port, so of like the addhandler we use with php. Apache sees .php and sends it off. But there is no file extentions, and it's a diff port, so can you tell apache, if you see 'folder' send it to port 8080 and then get the response?


bathory 05-13-2009 02:06 AM

If you want apache to forward any request for /folder to glassfish and passing also any arguements in the URI to thenew URI, you can use the following rewrite rule:

RewriteEngine on
RewriteRule ^folder/(.*)$1

You might take a look at mod_jk that is used to allow apache run webapps through tomcat. Doing a little search it seems that it can be used also with glassfish. Read this for more details

All times are GMT -5. The time now is 01:00 AM.