httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ujjwal Kumar <>
Subject Re: [users@httpd] Mod Rewrite for Server Status 503, depending upon URL
Date Sat, 17 Sep 2011 13:58:39 GMT
 /music is not a directory, it is just a URL which is routed to some
specific JSP (bound with a struts action), through struts.xml and
urlrewrite.xml (using tuckey).

I am restating the problem with more clarity.

Lets say we have 2 sites and
mysite deals with books, music, electronics, mobiles etc, partnersite deals
with only books and music

In case of system errors, say 503(site unavailable) I would like to
automatically redirect to to
and not do anything for and [ ie give out 503 as
it is]

How to set this up?

On Fri, Sep 16, 2011 at 9:36 PM, Mark Montague <> wrote:

> On September 16, 2011 2:58 , Ujjwal Kumar <>
> wrote:
>>  * /music is not a physical directory
> What is /music?  Is this URL proxied?  Is the content for this URL
> generated by a script?  Something else?
>   * In one sentence, the problem is to redirect specific urls (a) to a
>>    page only if that specific url (a) has a 503 error.
> The easiest way:  503 errors are not normal.  Find what is causing the
> error and fix it.  Alternatively, if the 503 error is being returned
> deliberately as a status by a script, modify the script so that the script
> does a 302 redirect instead (for example, to
> Another way: set up an ErrorDocument on your server (not on to
> handle all 503 errors.  Have this ErrorDocument be a CGI script or other
> active content.  The script should examine the REDIRECT_* environment
> variables set up by Apache HTTP Server to determine which URL the user was
> requesting, and, if the user was requesting /music, the script should
> generate a 302 response to redirect the user to
> If the user was not requesting /music, then the script should do whatever
> you want done in the case of a 503 error (display an error message for the
> user, etc.).  For details, see**
> 2.2/custom-error.html<>
> A harder way: Write an Apache HTTP Server module to do exactly what you
> want.  An alternative to writing a module in C would be to use mod_perl:
> I hope this helps.
> --
>  Mark Montague

View raw message