Support Center

Apache Sub-Domain based PURL hosting setup

Last Updated: Dec 28, 2012 11:21AM MST

Setting up sub-domain PURL hosting on Apache

purlHub's Landing Page technology supports all forms of Personalized URLs, providing marketers options and maximum control over the URL format.  Sub-domain based PURL resolution (AKA: host based PURLs) (i.e. http://JohnSmithX3.example.com) is a frequently used format for print driven campaigns, as it offers simple format for manual address entry.

As a fallback, purlHub also supports Query String based pURL resolution (i.e. http://www.example.com/index.html?_purl=JohnSmithX3).  This is most useful for Landing Page testing and development in offline mode.  But has additional applications for cases where web server administrative support (IT) is limited, and the PURLs are distributed via email.

This article offers a technical guideline to setup your Apache server for sub-domain based pURL resolution.  

With sub-domain or host name based pURLs, the personalization code (purlCode) is included in the domain component of the URL, usually as the 1st component (i.e. http://{purlCode}.mySite.com).  To host Landing Pages in this fashion, the following prerequisites must be in place.
  1. The DNS A record must be setup supporting a wildcard based host name resolving to the IP address of the webserver (*.mySite.com).  Use the "*" wildcard in the position of the domain name where you want to place the variable name {purlCode}.
  2. The web server must be configured serve the same Virtual Host for all requests where the HOST matches a sub-domain of the top level domain.
Step 1, check with your DNS Registrar to see if they support wildcards in host names, if they don't you'll to register the domain name through a DNS provider who does.  A few DNS providers do not support this feature.   GoDaddy.com, a highly popular DNS Registrar, is one of many DNS providers that support this option.

Step 2,  if all sub-domains of your chosen domain name resolve to your web server, you'll just need to setup your Apache Virtual Host.  The following is an example Apache VirtualHost configuration section.  Place similar directives in either the common http.conf file or an included apache conf file.

<VirtualHost *:80>
	ServerName mySite.com
	ServerAlias *.mySite.com
	DocumentRoot /var/www/mySite_httpdocs
	<Directory "/var/www/mySite_httpdocs">
	    Options -Indexes IncludesNOEXEC FollowSymLinks
	    AllowOverride All
	    Order allow,deny
	    Allow from all



  • Line #1  -  <VirtualHost *:80>
    This simply assigns the virtual host to all addresses that Apache is listening on.
  • Line #2  -  ServerName mySite.com
    This sets up the top-level domain that requests will match.
  • Line #3  -  ServerAlias *.mySite.com
    This matches any sub-domains of the top-level domain.
  • The remaining lines are specific to your Apache installation and site setup.
At this point, Apache is setup to host Landing Pages with or without a personalization code (purlCode).


Contact Us

  • Post a Public Question
  • Ask the Community
  • Email Us

Recent Discussions