Smart Subdomains

You can access the Smart Subdomains for the current domain by scrolling down to the Advanced Features section:

Smart Subdomains are special subdomains that return IP addresses generated by scripts. These scripts get information on the user requesting the IP address (like his/her country, network, other information) and make a decision on what IP address to return. The script linked to a smart subdomain runs every time a user requests the IP address of the subdomain. The scripts are written in PHP and run on a limited version of the PHP virtual machine.

Normal subdomains take precedence over smart subdomains, that is if you have both a normal subdomain and a smart subdomain with the same name on the same domain, GeoScaling will return the IP address of the normal subdomain, and will not execute the script inside the smart subdomain.

A script could for instance redirect users to the closest mirror based on the country or the network of the user, or to the least loaded machine, or redirect users to healthy servers when some of the servers go down.

The information that GeoScaling can send to a script is:

  • the 2 characters ISO code of the visitor's country (for example es for Spain, it for Italy etc)
  • city info - country, city name, latitude, longitude‚Ķ
  • the AS number (network name) of the visitor (example: as39756 is the HOSTWAY Romania network)
  • uptime information on your servers
  • extra information such as server load, sent through our XML-RPC API
  • the name of the smart subdomain connected to this script (for example www.example.com)
  • the IP address of the user requesting the IP

The script can then use any of the above items, or a combination, to choose which IP address to return to the user. Please click here for a short guide on writing smart subdomain scripts.

 
smart_subdomains.txt · Last modified: 2015/01/30 00:40 by mstenz
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki