mirror of
https://github.com/php/web-php.git
synced 2026-03-23 23:02:13 +01:00
Change multiple checks and references from 'www.php.net' to plainly 'php.net' to reduce 301's, fix a few broken items, and ease a bit of the load off the server (multiple connections per page when statically referenced as 'www.php.net.'
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
PHP_SAPI == 'cli' or die("Please run this script using the cli sapi");
|
||||
$BASE = "http://www.php.net";
|
||||
$BASE = "http://php.net";
|
||||
|
||||
function ce(DOMDocument $d, $name, $value, array $attrs = array(), DOMNode $to = null) {
|
||||
if ($value) {
|
||||
|
||||
@@ -48,7 +48,7 @@ site_header("Copyright", array("current" => "footer"));
|
||||
|
||||
<p>
|
||||
For more information on the PHP Group and the PHP project, please see
|
||||
<a href="http://www.php.net/">the PHP homepage</a>.
|
||||
<a href="http://php.net/">the PHP homepage</a>.
|
||||
</p>
|
||||
|
||||
<?php site_footer();
|
||||
|
||||
@@ -33,7 +33,7 @@ function random_bgcolor($min, $max)
|
||||
<p>
|
||||
Right click on one of the images and select "Save Image As" to save the
|
||||
logo (except where otherwise indicated). Then, link it to the main PHP
|
||||
site at <code>www.php.net</code>.
|
||||
site at <code>php.net</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -424,7 +424,7 @@ directory if you want to learn more about the testing mechanism.
|
||||
<li>PHP (the language)</li>
|
||||
<li>PECL (various additional PHP functionality in the form of extensions)</li>
|
||||
<li>PEAR (reusable PHP component library)</li>
|
||||
<li>Websites (www.php.net, qa.php.net, doc.php.net, edit.php.net, etc.)</li>
|
||||
<li>Websites (php.net, qa.php.net, doc.php.net, edit.php.net, etc.)</li>
|
||||
<li>Documentation (PHP, PECL, PEAR, etc.)</li>
|
||||
<li>System administration (mail servers, web servers, build-boxes, monitoring, etc.)</li>
|
||||
<li>Etc., etc., (etc.)</li>
|
||||
|
||||
@@ -214,7 +214,7 @@ EOT;
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sub">Creating experimental PHP extensions</td>
|
||||
<td>Maintaining www.php.net</td>
|
||||
<td>Maintaining php.net</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sub">Submitting a patch to PHP</td>
|
||||
|
||||
@@ -23,7 +23,7 @@ if (isset($shortname) && $shortname) {
|
||||
<meta charset="utf-8"/>
|
||||
|
||||
<link rel="shortcut icon" href="<?php echo $STATIC_ROOT ?>favicon.ico" />
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="http://www.php.net/phpnetimprovedsearch.src" title="Add PHP.net search" />
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="http://php.net/phpnetimprovedsearch.src" title="Add PHP.net search" />
|
||||
<link rel="alternate" type="application/atom+xml" href="<?php echo $MYSITE ?>releases.atom" title="PHP Release feed" />
|
||||
<link rel="alternate" type="application/atom+xml" href="<?php echo $MYSITE ?>feed.atom" title="PHP: Hypertext Preprocessor" />
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/* $Id$ */
|
||||
|
||||
// Set the static content root differently on php.net
|
||||
if ($MYSITE == "http://www.php.net/") {
|
||||
if ($MYSITE == "http://www.php.net/" || $MYSITE == 'http://php.net/') {
|
||||
$_SERVER['STATIC_ROOT'] = 'http://static.php.net/www.php.net';
|
||||
} elseif ($MYSITE == 'https://www.php.net/') {
|
||||
} elseif ($MYSITE == 'https://www.php.net/' || $MYSITE == 'https://php.net/') {
|
||||
$_SERVER['STATIC_ROOT'] = 'https://static.php.net/www.php.net';
|
||||
} elseif (!isset($_SERVER['STATIC_ROOT'])) {
|
||||
$_SERVER['STATIC_ROOT'] = "";
|
||||
@@ -836,7 +836,7 @@ function site_header_beta($title = '', $config = array())
|
||||
|
||||
// For static content
|
||||
// FIXME: How does static.php.net work? Will it get the /js/ folders?
|
||||
if (false && $MYSITE == "http://www.php.net/") {
|
||||
if (false && ($MYSITE == "http://www.php.net/" || $MYSITE == 'http://php.net/')) {
|
||||
$STATIC_ROOT = "http://static.php.net/www.php.net/";
|
||||
} elseif (false && !empty($_SERVER["STATIC_ROOT"])) {
|
||||
$STATIC_ROOT = $_SERVER["STATIC_ROOT"];
|
||||
|
||||
@@ -28,7 +28,7 @@ function load_check()
|
||||
// Adhere to user preferences if valid
|
||||
$user_mirror = myphpnet_mirror();
|
||||
if (isset($MIRRORS[$user_mirror]) && $MIRRORS[$user_mirror][7] == MIRROR_OK
|
||||
&& $user_mirror != "http://www.php.net/") {
|
||||
&& $user_mirror != "http://php.net/") {
|
||||
header("Location: $user_mirror" . substr($_SERVER['REQUEST_URI'], 1));
|
||||
exit;
|
||||
}
|
||||
@@ -38,7 +38,7 @@ function load_check()
|
||||
|
||||
// Find potential close mirrors
|
||||
foreach ($MIRRORS as $murl => $mirror) {
|
||||
if ($murl != 'http://www.php.net/' && $mirror[7] == MIRROR_OK && $mirror[4] != MIRROR_SPECIAL) {
|
||||
if ($murl != 'http://php.net/' && $mirror[7] == MIRROR_OK && $mirror[4] != MIRROR_SPECIAL) {
|
||||
if ($mirror[0] == $COUNTRY) {
|
||||
$close_mirrors[] = $murl;
|
||||
} else {
|
||||
|
||||
@@ -17,7 +17,7 @@ function is_primary_site($site = FALSE)
|
||||
{
|
||||
global $MYSITE;
|
||||
if (!$site) { $site = $MYSITE; }
|
||||
return $site == "http://www.php.net/";
|
||||
return $site == "http://php.net/";
|
||||
}
|
||||
|
||||
// Returns true if the current (or specified)
|
||||
|
||||
6
mod.php
6
mod.php
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
This page supports the PHP.net automoderation system
|
||||
with enabling users to confirm their emails via the web.
|
||||
This script only need to run on www.php.net.
|
||||
This script only need to run on the primary php.net box.
|
||||
*/
|
||||
|
||||
$_SERVER['BASE_PAGE'] = 'mod.php';
|
||||
@@ -12,8 +12,8 @@ include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
|
||||
|
||||
site_header("Email confirmation", array("current" => "community"));
|
||||
|
||||
// Only run on www.php.net
|
||||
if ($MYSITE != "http://www.php.net/") {
|
||||
// Only run on main php.net box.
|
||||
if ($MYSITE != "http://www.php.net/" && $MYSITE != 'http://php.net/') {
|
||||
echo <<<ERROR
|
||||
<h1>Email confirmation failed</h1>
|
||||
|
||||
|
||||
4
my.php
4
my.php
@@ -227,7 +227,7 @@ echo (myphpnet_hidesuggest() ? ' checked="checked"' : '');
|
||||
<h2>Mirror site redirection</h2>
|
||||
|
||||
<p>
|
||||
The www.php.net site redirects users to mirror sites in several cases
|
||||
The php.net site redirects users to mirror sites in several cases
|
||||
automatically. It tries to find a close mirror first (a mirror in the
|
||||
user's country), and if no such mirror is found, it selects one mirror
|
||||
randomly. Here you can set one preferred mirror site for yourself in
|
||||
@@ -249,7 +249,7 @@ foreach ($mirror_sites as $murl => $mdata) {
|
||||
|
||||
// Skip inactive mirrors
|
||||
if (mirror_status($murl) != MIRROR_OK ||
|
||||
$murl == "http://www.php.net/") { continue; }
|
||||
$murl == "http://www.php.net/" || $murl == 'http://php.net/') { continue; }
|
||||
|
||||
// Compute user friendly mirror name
|
||||
if ($murl == "NONE") {
|
||||
|
||||
@@ -8,7 +8,7 @@ site_header("Privacy Policy", array("current" => "footer"));
|
||||
<h1>Privacy Policy</h1>
|
||||
|
||||
<p>
|
||||
This privacy policy covers www.php.net and its associated mirrors.
|
||||
This privacy policy covers php.net and its associated mirrors.
|
||||
</p>
|
||||
|
||||
<h2>Email</h2>
|
||||
|
||||
@@ -156,7 +156,7 @@ if ($snippet = is_known_snippet($notfound)) {
|
||||
// admin/ since these tend to be script-kiddie hack attempts
|
||||
if(strlen($notfound) > 2 && !strstr($notfound,'tp://') && !strstr($notfound,'admin/')):
|
||||
$srch_rqst = "/ws.php?profile=$scope&q=".urlencode($notfound)."&lang=$LANG&results=10&start=0&mirror=".trim(substr($MYSITE,7),'/');
|
||||
$url = "http://www.php.net".$srch_rqst;
|
||||
$url = "http://php.net".$srch_rqst;
|
||||
$data = fetch_contents($url);
|
||||
if(!is_array($data)) {
|
||||
$res = unserialize($data);
|
||||
|
||||
@@ -42,7 +42,7 @@ $per_page = 10;
|
||||
|
||||
$valid_profiles = array('all', 'local', 'manual', 'news', 'bugs', 'pear', 'pecl', 'talks');
|
||||
$scope = in_array($profile, $valid_profiles) ? $profile : 'all';
|
||||
$srch_host = "www.php.net";
|
||||
$srch_host = "php.net";
|
||||
$srch_rqst = "/ws.php?profile=$scope&q=$uq&lang=$ul&results=$per_page&start=$s&mirror=".trim(substr($MYSITE,7),'/');
|
||||
$url = "http://".$srch_host.$srch_rqst;
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@ site_header("A Tourist's Guide", array("current" => "help"));
|
||||
<h1>PHP.net: A Tourist's Guide</h1>
|
||||
|
||||
<p>
|
||||
Everyone knows the <code>www.php.net</code> site. All of us went there sooner or later,
|
||||
Everyone knows the <code>php.net</code> site. All of us went there sooner or later,
|
||||
and will keep going back there. This is the central reference point for PHP
|
||||
users, and there is a wealth of information there. Not all of it is obvious.
|
||||
Come with me, I'll show you.
|
||||
</p>
|
||||
|
||||
<h2><a href="http://www.php.net/">www.php.net</a>: Main Website</h2>
|
||||
<h2><a href="http://php.net/">php.net</a>: Main Website</h2>
|
||||
|
||||
<p>
|
||||
This is the primary web site. The front page is where major news is published:
|
||||
|
||||
@@ -13,8 +13,8 @@ site_header("PHP Software", array("current" => "help"));
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php echo make_image("logos/php-icon-white.gif", $alt = "www.php.net", "left") ?>
|
||||
<a href="http://www.php.net/">www.php.net</a><br />
|
||||
<?php echo make_image("logos/php-icon-white.gif", $alt = "php.net", "left") ?>
|
||||
<a href="http://php.net/">php.net</a><br />
|
||||
Main site for the PHP project.<br clear="left" />
|
||||
</p>
|
||||
<p>
|
||||
|
||||
2
tips.php
2
tips.php
@@ -85,7 +85,7 @@ For more info, see
|
||||
<ul>
|
||||
<li>Name: PHP</li>
|
||||
<li>Keyword: p</li>
|
||||
<li>Address: http://www.php.net/search.php</li>
|
||||
<li>Address: http://php.net/search.php</li>
|
||||
<li>Query string: pattern=%s&show=quickref</li>
|
||||
</ul>
|
||||
<p class="note">
|
||||
|
||||
12
ws.php
12
ws.php
@@ -11,11 +11,11 @@ $s = isset($_REQUEST['start']) ? (int)$_REQUEST['start'] : 1;
|
||||
$l = isset($_REQUEST['lang']) ? htmlspecialchars($_REQUEST['lang'], ENT_QUOTES) : 'en';
|
||||
$m = isset($_REQUEST['mirror']) ? htmlspecialchars($_REQUEST['mirror'], ENT_QUOTES) : '';
|
||||
$sites = array( 'all'=>'php.net',
|
||||
'local'=>'www.php.net',
|
||||
'quickref'=>'www.php.net',
|
||||
'404quickref'=>'www.php.net',
|
||||
'manual'=>"www.php.net/manual/$l",
|
||||
'404manual'=>"www.php.net/manual/$l",
|
||||
'local'=>'php.net',
|
||||
'quickref'=>'php.net',
|
||||
'404quickref'=>'php.net',
|
||||
'manual'=>"php.net/manual/$l",
|
||||
'404manual'=>"php.net/manual/$l",
|
||||
'news'=>'news.php.net',
|
||||
'bugs'=>'bugs.php.net',
|
||||
'pear'=>'pear.php.net',
|
||||
@@ -30,7 +30,7 @@ if(isset($sites[$_REQUEST['profile']])) {
|
||||
$scope = htmlspecialchars($_REQUEST['profile'], ENT_QUOTES);
|
||||
// If they are doing a manual search in a language we don't have a translation for, default to English
|
||||
if($scope == 'manual' && empty($ACTIVE_ONLINE_LANGUAGES[$l])) {
|
||||
$sites['manual'] = "www.php.net/manual/en";
|
||||
$sites['manual'] = "php.net/manual/en";
|
||||
}
|
||||
} else {
|
||||
$scope = 'all';
|
||||
|
||||
Reference in New Issue
Block a user