5 Replies Latest reply on Aug 1, 2007 11:23 AM by quester

    Lower case context for WebApp

    pander

      Hi,

      I have a WebApp deployed on my server. Let's call it "TEST.war"

      People that visit my site would go to the URL http://www.mysite.com/TEST

      I am getting a lot of people going to the URL http://www.mysite.com/test

      Is there a way I can make JBOSS forward any requests where people have typed the URL in lower case go to the correct (Upper Case) URL with regards to my WebApp?

      Regards,
      Paul.

        • 1. Re: Lower case context for WebApp
          thejavafreak

          You set this on the webserver side. If you use Apache httpd server, AFAIK you set this on .htaccess

          • 2. Re: Lower case context for WebApp
            pander

            OK,

            But I'm not using Apache or any other webserver, I'm simply using JBOSS which obviously has Tomcat as part of it.... is there somewhere in Tomcat that I can set this up?

            Regards,
            Paul.

            • 3. Re: Lower case context for WebApp
              thejavafreak

              Tomcat is not a webserver. I think you still need to use a webserver to achieve this.

              • 4. Re: Lower case context for WebApp
                pander

                Found the answer, so just thought I would post it.

                JBOSS can perform URL rewriting via Tomcat and Valves.

                You need to modify the server.xml (or the context.xml within your webapp) and add the following valve.



                You then need to copy the jbossweb-rewrite.jar to you $SERVER/lib directory

                Then create a folder to store your rewrite.properties file. If you used server.xml and placed the valve within the context of the Engine then you need to create a folder called $SERVER/conf/<engine-name>

                So for me that was default/conf/jboss.web

                Create a file in there called rewrite.properties, enter your rewrite rules and cycle the server.

                Regards,
                Paul.

                • 5. Re: Lower case context for WebApp
                  quester

                  Where is the jbossweb-rewrite.jar located? I have searched my entire JBoss directory structure and I can't find it.