Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have deployed a tomcat application and made the necessary configurations to web a server (for eliminating port etc.).

I can access the application following way

But I would like to access the app even when user enters (just url, no app name) (just domian name)

I am new to Apache configurations, any pointers, or samples would greatly help.

I thought "proxy pass" would resolve...
Do I need to look for rewriting rules or any other?

share|improve this question

I have solved this by putting an index.html file into the webapps/ROOT folder containing a normal HTML redirection:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <meta http-equiv="REFRESH" content="0;url=./appname/"></HEAD>
share|improve this answer

You could deploy your application as the ROOT webapp in Tomcat in order to eliminate the prefix you still have. Just unzip your app to the $CATALINA_HOME/webapps/ROOT folder or - if deployed as zipped .war file - just rename your file to ROOT.war when putting it into the webapps folder. It will then be available without application prefix.

Regarding your domain names with / without "www" part: If you are using Apache in front of Tomcat, then the mod_rewrite reference documentation has a good section describing canonical hostnames.

share|improve this answer
thank you, I was able to solve with mod_rewrite – user79333 Apr 29 '11 at 4:55

For those who may need solution, I just added the following to httpd.conf and it is working fine for my issues:

RewriteEngine on  
RewriteCond %{HTTP_HOST} !^www\. [NC]  
RewriteCond %{HTTP_HOST} !^$  
RewriteRule ^/?(.*) http://www.%[HTTP_HOST}/$1 [L,R,NE]  

ProxyPass         /appname  http://localhost:8080/appname  
ProxyPassReverse  /recsconnect  http:...  
ProxyPass / http...  
ProxyPassReverse / http....  

I forgot earlier adding last two lines.

share|improve this answer

Another option worth considering, is the UrlRewriteFilter. Especially useful if you already know mod_rewrite but don't want to use apache.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.