|
Posted by Philip Ronan on 09/27/21 11:37
windandwaves wrote:
> Hi Folk
>
> My .htaccess file reads:
>
> ErrorDocument 400 /404.php
> ErrorDocument 401 /404.php
> ErrorDocument 403 /404.php
> ErrorDocument 404 /404.php
What happened to 400.php, 401.php and 403.php?
> This means if someone types in the wrong address (e.g.
> www.mysite.com/wrongpage.php ) then they are automatically redirected to
> 404.php
>
> Now, I would like this to continue, but also return a true 404 (as required
> by Google), can you tell me how to do this?
>
> Can you confirm that just placing the following at the top of my script
> suffices:
>
> header("HTTP/1.0 404 Not Found");
Yes
> even if I use ob_start and ob_flush?
As long the header() statement is the first thing in your script.
Or you could just use ordinary HTML documents for your error pages. The
server will take care of the 404 headers for you.
--
philronan [@] blueyonder [dot] co [dot] uk
Navigation:
[Reply to this message]
|