5

Is there a way to make web application context case in-sensitive?

Basically i'm doing the following in jboss-web.xml

<jboss-web>
    <context-root>cap</context-root>
</jboss-web>

I'm able to access the app via localhost:8080/cap, but trying to make it accessible via localhost:8080/Cap or localhost:8080/CAP. Any ideas please?

Ondra Žižka
  • 40,240
  • 36
  • 196
  • 259
Sudheer Palyam
  • 2,429
  • 2
  • 22
  • 27
  • 1
    If you want tou use Apache in front of your server you can also check these questions: http://stackoverflow.com/questions/1353807/mod-rewrite-change-url-case and http://stackoverflow.com/questions/1998156/case-insensitive-urls-with-mod-rewrite. – Lukasz Stelmach Sep 22 '11 at 07:08

1 Answers1

6

Put apache+mod_proxy in front of jboss and use url-rewriting or redirection (easier option). Example of rewrite:

RewriteEngine on
RewriteRule ^/Cap$ /cap/ [R]
RewriteRule ^/CAP$ /cap/ [R]

You would put the above to httpd.conf or a similar location.

Tair
  • 3,729
  • 1
  • 16
  • 32