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
  • 43,948
  • 41
  • 217
  • 277
Sudheer Palyam
  • 2,499
  • 2
  • 23
  • 28
  • 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,779
  • 2
  • 20
  • 33