You are here: Re: returning a true 404 « PHP Programming Language « IT news, forums, messages
Re: returning a true 404

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация