• Post Reply Bookmark Topic Watch Topic
  • New Topic

Welcome File

 
Gobind Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a web application that handles partial URL's by redirecting to a defined welcome file.

My question is how do I use the same strategy if the application is not deployed. Say for example I have to undeploy the application from the server, and a user makes a request for the webapp. How do I display a default "under construction" page?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you undeploy the web app, it doesn't exist and can't serve anything.

The strategy I employ if I need to take an app down for any extended period (meaning anything other than a quick restart), is to stop the app, temporarily change the docbase of the context to a simple web app that presents the "We'll be right back" page, and restart the app.

When it's time to bring the app back up, I stop the app, restore the docbase, and restart.

(Note: I only stop and start the web app, not the entire container).
[ August 08, 2006: Message edited by: Bear Bibeault ]
 
Rusty Smythe
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do it with .htaccess (assuming your apache server is set up to allow this: AllowOverride must be set to the appropriate value).

Suppose your site is www.example.com/myapp and your welcome file is called welcome.html, in the same directory.

Edit the .htaccess in your myapp directory (create the file if it doesn't exist) and add the following:


Now when someone tries to go to http://www.example.com/myapp/lunch/fruit/apple/core.do

they will get the welcome.html file, assuming lunch/fruit/apple/core.do does not exist--when your application is undeployed.

You could put the welcome file in another directory, as long as it can be seen from the web. Note also that it MUST be accessible from the same URL (www.example.com), otherwise you'll get wacky results.

[ August 09, 2006: Message edited by: Rusty Smythe ]
[ August 09, 2006: Message edited by: Rusty Smythe ]
 
Gobind Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Jonas J2EE server.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rusty Smythe:
You can do it with .htaccess (assuming your apache server is set up to allow this:


What led you to believe apache was being used?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!