When you visit any documentation page on php.net, your browser is redirected to a regional server, presumably to speed up response times.

For example, accessing php.net from the US, my browser is typically redirected to us.php.net, us2.php.net, etc.

Sounds great, except that links posted in questions and answers on SO retain those hostnames, so you end up seeing links to us.php.net, ru.php.net, be.php.net, de.php.net, etc.

This tends to defeat the purpose of having regionally-located servers if people are going to share links with people who live thousands of miles away from the servers that they point to.

It seems like this could be handled automatically and transparently via a regular expression search and replace, similar to automatic removal of salutations.

Note that there are a number of subdomains that should be left alone.

  • 2
    This is also a user-solvable issue a great deal of the time. A link to http://php.net/functionname does the right thing. Linking to non-function-reference sections of the docs is a bit more challenging.
    – Charles
    Jan 23, 2012 at 2:48
  • 1
    This also happens to be an English-only site, so I doubt they care. Most links that take you to a non-English version of documentation would probably get changed.
    – animuson StaffMod
    Jan 23, 2012 at 3:01

1 Answer 1


I agree that these links should not be region-specific. However, I think it's very dangerous to start applying regexes whenever a situation like this arises.

This site is fairly popular on SO; a search for url:"*.php.net*" yields over 5,000 results. That makes it a pretty popular site. I don't think we should do this for sites that have fewer links than that.

However, I think that the root problem is with php.net's architecture. They seem to be a little bit subdomain happy, with these 108 region-specific mirror sites and 14 other subdomains. They should anticipate that people will share their links, and design their service such that their multi-region CDN is invisible to their users. Or, at the very least, they could provide a permalink.

  • Good thing you included the search link; I just noticed from the first result a link to wiki.php.net, which should definitely be left alone!
    – user164291
    Jan 23, 2012 at 1:33
  • 1
    Yeah, I didn't want to specify url:http:\\us.php.net* url:http:\\us1.php.net* etc. for all 108 sites, that would be too tedious. Be careful with those regexes! Jan 23, 2012 at 1:38

You must log in to answer this question.