Documentation
Previous | Next | Home

Hosting

WebSuite is fully capable of hosting individual and multiple web sites and web-based applications. Domain names can be pointed to WebSuite installations utilizing dedicated IP addresses. Multiple addresses can be incorporated through the use of virtual hosting.

Domains referencing WebSuite servers must still be implemented in conjunction with 3rd party DNS servers. Optionally, DNS services available from companies such as myDomain.com can also be used.

Virtual hosting is implemented by adding dynamic redirection to the default server page. This is implemented by incorporating the following instructions into the INDEX.AP page in the \sdweb\home directory:


<[
    	// Get the current session object
    	session = new( "session", param( 1 ), param( 2 ) )
 
    	// Get the name of the host that is accessing the server
    	host = upper( session.data( "CLIENT_HOST" ) )
 
    	// Check for a redirected host
    	switch ( host )
      	   case "NEWYORKCARGOCORP.COM"
          case "WWW.NEWYORKCARGOCORP.COM"
        	// redirect if newyorkcargocorp.com request
        	session.redir( "/newyorkcargocorp/index.html" )
        	return( 1 )
        
      	   case "USAJACKETS.com"
      	   case "WWW.USAJACKETS.COM"
        	// redirect if usajackets request
        	session.redir( "/usajackets/index.html" )
        	return( 1 )
 
      	   case "LEATHERJACKETS.com"
          case "WWW.LEATHERJACKETS.COM"
		// redirect if leatherjackets request
		session.redir( "/leatherjackets/index.html" )
		return( 1 )
 
   	end
 ]>
<html>
<body>
<h1>This is the default home Page!</h1>
</body>
</html>

The main part of this code is the line containing:

        host = upper( session.data( "CLIENT_HOST" ) )

This extracts the referring host name of user requesting access to the server. It is then converted to upper case and compared to a list of host names supported by the server. IF a match is found, the REDIR method of the SESSION OBJECT is used to redirect the user to the appropriate directory within the server.




(c) 2001 by West Coast Web Adventures, Inc., All Rights Reserved