1 Reply Latest reply on Jul 18, 2008 11:56 AM by pdhaigh

    URL rewriting

    pdhaigh
      Hi all,

      I'm sure this is a very simple point, but I'm having some trouble with URL rewriting.

      What I would like to do is have my application accessible at: http://www.mydomain.com/foo.jsf

      Obviously this excludes the application name - the natural URL is: http://www.mydomain.com/myapp/foo.jsf

      With Apache fronting JBossAS, and mod_rewrite doing this:

      RewriteRule ^/myapp/.*$ - [L]
      RewriteRule ^/(.*)$ /myapp/$1 [PT]

      I can then access  http://www.mydomain.com/foo.jsf and everything works fine, until I hit a command link, or other form submission, at which point the application name is added: http://www.mydomain.com/myapp/foo.jsf

      Any advice on a neat solution to this would be great!

      cheers

      phil
        • 1. Re: URL rewriting
          pdhaigh

          In case anyone else is stuck on the same..


          You can set the default context to / in your application.xml - but you can only have one application set like this per JBossAS instance.


          In this sense an instance is defined an actual instance (i.e. different server config folder), or a virtual host. You can deploy each of your applications to a a different JBossAS virtual host, and have them all set to context root /.


          I don't believe there is a way of achieving this just with Apache rewrites.