Re: cvs: pearweb /public_html/error 404-manual.php
| From: | Helgi Þormar Þorbjörnsson | Date: | Mon, 13 Apr 2009 22:50:38 +0000 |
| Subject: | Re: cvs: pearweb /public_html/error 404-manual.php | ||
| References: | 1 | Groups: | php.pear.cvs php.pear.core |
| Request: | Send a blank email to pear-core+get-8336@lists.php.net to get a copy of this message | ||
On Wed, Apr 8, 2009 at 10:19 AM, Christian Weiske <cweiske@php.net> wrote:
> cweiske Wed Apr 8 09:19:47 2009 UTC
>
> Modified files:
> /pearweb/public_html/error 404-manual.php
> Log:
> Redirect to english manual file if that exists
>
>
>
> http://cvs.php.net/viewvc.cgi/pearweb/public_html/error/404-manual.php?r1=1.6&r2=1.7&diff_format=u
> Index: pearweb/public_html/error/404-manual.php
> diff -u pearweb/public_html/error/404-manual.php:1.6
> pearweb/public_html/error/404-manual.php:1.7
> --- pearweb/public_html/error/404-manual.php:1.6 Tue Feb 3 15:09:42 2009
> +++ pearweb/public_html/error/404-manual.php Wed Apr 8 09:19:47 2009
> @@ -1,3 +1,13 @@
> +<?php
> +$file = $_SERVER['REQUEST_URI'];
> +//try english file
> +$enfile = str_replace('/manual/', '/manual/en/', $file);
> +if (file_exists(dirname(__FILE__) . '/../' . $enfile)) {
> + header('HTTP/1.0 301 Moved permanently');
> + header('Location: ' . $enfile);
> + exit();
Hi,
Pretty sure 301 is not the proper response in this case, what if the
file exists at a later time ? You just told the client it has been
moved permanently :-) There must be a better HTTP header for this.
- Helgi