Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Multiple ErrorDocuments based on request


designaweb - 10:24 am on Jul 28, 2009 (gmt 0)


That doesn't work here. Your location header will cause a 302 redirect sent to the client, not a 404 not found

Are you sure? I also use this:

if ($redirect_url) {
// Redirect to stripped URL
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$redirect_url."");
exit;
}

I just checked, and the headers returned by that script are:

HTTP/1.1 301 Moved Permanently
Date: Tue, 28 Jul 2009 10:21:02 GMT
Server: Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.5 mod_ssl/2.2.4 OpenSSL/0.9.8e
X-Powered-By: PHP/5.2.3-1ubuntu6.5

So the

header("HTTP/1.1 301 Moved Permanently");

does seem to be working in that case, why wouldn't it in the 404 example? Your solution is more elegant and faster, but I am asking this to learn...


Thread source:: http://www.webmasterworld.com/apache/3960803.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com