CONTACT US: 1-800-622-4403
ABOUT    CONTACT SALES    SERVICE AREAS
Domains To Datacenter Since 1994

Hosting Multiple Domains on One IP Address (SuperAccount)

Often, it may not be very cost effective to host client sites individually. Instead, you may want to store individual sites as subdirectories of a single main site, and then redirect incoming URLs to the proper client page. Fortunately, ASP makes this task fairly simple.

Putting it Together

The example below is the actual content of the ASP page.  This page should be the first page in your website (the main wwwroot directory) and the filename should be index.asp or default.asp.

For our example, let's suppose we have a main Web site at www.myprimarywebsite.com. Now, in addition, we have two clients that have domains of www.secondwebsite.com and www.thirdwebsite.com.  We decide to create subdirectories for each of the clients and redirect the domains to the appropriate page.  You will need to decide how to manage your site content and file structure.  It's recommended that you place each website in their own subdirectory with unique and easily identifiable directory names.  The Example shows the main page's completed code; The ASP code should be the only content of the ASP page, no HTML is needed.

Example:

<% @Language = "VBScript" %>
<% Option Explicit
Response.Buffer = True

Dim HostURL
HostURL = LCase(Request.ServerVariables("HTTP_HOST"))

Response.Status = "301 Moved Permanently"

'***************************************************
'*  this select/case will check a list of domains
'*  that are assigned to your account.  Make sure
'*  you use lowercase values for the domain names
'*  and URL's
'***************************************************

Select Case HostURL ' Find which site to redirect to

    Case "www.myprimarywebsite.com", "myprimarywebsite.com"
        Response.AddHeader "Location", "http://www.myprimarywebsite.com/index.html"

    Case "www.secondwebsite.com", "secondwebsite.com"
        Response.AddHeader "Location", "http://www.secondwebsite.com/2ndwebsitedirectory/index.htm"

    Case "www.thirdwebsite.com", "thirdwebsite.com"
        Response.AddHeader "Location", "http://www.thirdwebsite.com/3rdwebsitedirectory/index.htm"

    Case Else ' Default to main page
        Response.AddHeader "Location", "http://www.myprimarywebsite.com/index.html"

End Select

%>

The Result

A quick way to send traffic for your domains to their appropriate content.  From this example, if a web visitor would browse http://thirdwebsite.com they would be redirected to it's main web page (index.htm): http://www.thirdwebsite.com/thirdwebsitedirectory/index.htm

Once the visitor has reached the main page of the website (by the above script), the navigation and links for the thirdwebsitedirectory.com domain will be relative to the "thirdwebsitedirectory" directory.



Websites

  1. How To Install WordPress
  2. Hosting Multiple Domains on One IP Address (SuperAccount)
  3. Where can I find the FTP information for my POA account?
  4. How to modify CSS on Mobile Devices
  5. How to generate a CSR, purchase & Install the Certificate in the POA System
  6. Change Your Domain Name using WordPress
  7. How to enable .NET 4.0 for your POA Account.
  8. How to remove Pages/Posts from Wordpress Search
  9. How to disable all Wordpress plugins using MySQL
  10. Remove index.php from Wordpress URL
  11. How to move a Drupal site from one host to another
  12. How to move a Wordpress site from one host to another
  13. How to change the Wordpress site URL
  14. Masking Your Email from Spammers with WordPress + PHP
  15. How to Redirect a Registered Domain
  16. Changing the Wordpress URL Path to web root "/" or another path
  17. Simple Way to Secure a WordPress Website
  18. How to restart your website in Control Panel.
  19. How to Block Referral SPAM from your Website
  20. Creating Campaigns in Google Analytics
  21. Switching over to a New InfoQuest account.
  22. Stopping your website through the customer control panel.
  23. Deleting a domain from your account.
  24. Where do I go to view my web stats (AWStats) for my site?
  25. How to change Wordpress siteURL to IP address using phpmyadmin
  26. How to enable "anonymous access" to browse my site.
  27. How to access Wordpress files.
  28. How to add a dedicated/exclusive IP address to your account.
  29. How to upload website content to the server.
  30. Update Directory Path for Website.
  31. Password protecting a folder on your site on POA.
  32. Add Structured Data Location Schema to your website

Feedback and Knowledge Base