svn: /web/php/trunk/ error.php
| From: | Rasmus Lerdorf | Date: | Tue, 19 Jul 2011 04:52:56 +0000 |
| Subject: | svn: /web/php/trunk/ error.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-11696@lists.php.net to get a copy of this message | ||
rasmus Tue, 19 Jul 2011 04:52:56 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=313411
Log:
If someone is looking for something in distributions/* and it isn't there,
send them to the /releases page since that is likely to be most helpful.
Also add a www.php.net-specific debug referer log to try to track down
some of these persistent bad distributions/* links
Changed paths:
U web/php/trunk/error.php
Modified: web/php/trunk/error.php
===================================================================
--- web/php/trunk/error.php 2011-07-19 02:37:23 UTC (rev 313410)
+++ web/php/trunk/error.php 2011-07-19 04:52:56 UTC (rev 313411)
@@ -118,6 +118,17 @@
}
// ============================================================================
+// If someone is looking for something in distributions/* and it isn't there,
+// send them to the /releases page since that is likely to be most helpful.
+if (preg_match("!^distributions/.*!", $URI, $array)) {
+ // Debug: Logging referrers on www.php.net temporarily
+ if($_SERVER['SERVER_NAME']=='www.php.net' &&
!empty($_SERVER['HTTP_REFERER'])) {
+ file_put_contents("/var/tmp/refer.txt","$URI from
{$_SERVER['HTTP_REFERER']}\n",FILE_APPEND);
+ }
+ mirror_redirect("/releases/");
+}
+
+// ============================================================================
// The trailing slash only causes problems from now on
$URI = preg_replace('!/+$!', '', $URI);