Thanks for all your help.

I ended up using the RewriteRule recommended below by Rich Bowen along with an 
ErrorDocument (as per Nick Kew) to provide more details about the error.

300/400 series would have been more useful but client requirements don't always 
make sense.  However, they are happy that a very simple config exercise in 
Apache was able to solve the problem.


 


----- Original Message ----
From: Rich Bowen <[email protected]>
To: [email protected]
Sent: Fri, December 4, 2009 6:25:39 PM
Subject: Re: [us...@httpd] mod_rewrite/rewriterule - forcing a HTTP 500 code on 
all access attempt?


On Dec 4, 2009, at 20:25 , Frank Z wrote:

> is there a way via RewriteRule to force all access to a certain URL to return 
> with a HTTP 500
> 
> e.g.  i have a number 3 applications that are or will be obsoleted and is 
> expected to return a 500 to all callers who try to access it.
> 
> so when someone tries to access a deprecated URL such as 
> http://myserver/myApp1  I would like to send back a 500 and preferably some 
> textual information (nice to have).
> 
> Will it be possible to do this via mod_rewrite?

You can use the R flag to return any valid HTTP status
RewriteRule ^/myApp1 - [R=500]

but, as Nick says, returning a 500 for it seems to be a lot less useful than a 
404 or a 410 and an ErrorDocument.

--
Rich Bowen
[email protected]




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [email protected]
  "  from the digest: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [email protected]
   "   from the digest: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to