httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Montague <>
Subject Re: [users@httpd] Mod Rewrite for Server Status 503, depending upon URL
Date Fri, 16 Sep 2011 16:06:10 GMT
On September 16, 2011 2:58 , Ujjwal Kumar <> 
>   * /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

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 

I hope this helps.

   Mark Montague

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message