Friday 25 July 2014

How to make my context root case insensitive

Hi everyone,

I am working for new project and as we are using a very basic application server i.e. JBOSS EAP 6.2 with Apache web server 2.22 configured using mod_jk . Like Websphere and weblogic, Jboss doesn’t have that much of user friendly interface so we have to configured the lot of things by changing the configuration files and using command line. This is the very good learning for me, as I worked with many of configuration files and get to know how exactly the request flow in three tire architecture.

Few days before my team facing the following issue; we raise the case to Redhat for resolving this and finally got the solution.

Issue :

My application context root was something like Sampleapps where ‘S’ is ne Uppercase. When I am trying to access the url using all lower or uppercase or anything else than Sampleapps it shows the error:

The requested URL /SAMPLEAPPS/login.jsp was not found on this server.

Here I want to make my context root case insensitive and for that I follow the below suggestion given by Redhat and its working fine.

 Solution :

  • Open file httpd.conf from location APACHE_HOME/conf
  • Uncomment the line LoadModule rewrite_module modules/mod_rewrite.so
  • Add following lines to bottom of the file
RewriteEngine On  
RewriteRule /sampleapps/(.*) /Sampleapps/$1 [PT,NC]
  • Save the changes and restart the apache server to activate it.

This is working in my case but for more information about mod_rewrite and RewriteEngine please find the link http://httpd.apache.org/docs/current/mod/mod_rewrite.html 


Thanks to Mr. Muthu Krishnan for helping me in this.

Effort only fully releases its reward after a person refuses to quit.”

Regards,
Akhilesh B. Humbe

No comments:

Post a Comment

Popular Posts