Reply to topic
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 570
Location: Harrisburg, PA
Reply with quote
This should work in Coldfusion

Put this in the very top of your Application.cfm or Application.cfc in the root of your site.

Code:

<cfswitch expression="#CGI.Server_Name#">
      <cfcase value="domain1.com,www.domain1.com" delimiters=",">
         <cfinclude template="/domain1/#cgi.script_name#">
         <cfabort>
      </cfcase>
       <cfcase value="domain2.com,www.domain2.com delimiters=",">
         <cfinclude template="/domain2/#cgi.script_name#">
         <cfabort>
      </cfcase>
      <cfdefaultcase>
      </cfdefaultcase>
   </cfswitch>


OR. If you want to host subdomains, get a Linux or Windows VPS and you can host all of the domains you want. Laughing
parkavedavinci


Joined: 28 Feb 2007
Posts: 1
Location: Rochester, NY
Reply with quote
How does the given CFM Redirect script handle everything if an application on the subdirectory has its own Application.cfm ...

for example: "forums.mydomain.com/index.cfm" points to "www.mydomain.com/forums/index.cfm" (based on the Script in ...mydomain.com/application.cfm) - however, the forums Directory also has its own Application.cfm for alternate purposes.
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 570
Location: Harrisburg, PA
Reply with quote
parkavedavinci wrote:
How does the given CFM Redirect script handle everything if an application on the subdirectory has its own Application.cfm ...

for example: "forums.mydomain.com/index.cfm" points to "www.mydomain.com/forums/index.cfm" (based on the Script in ...mydomain.com/application.cfm) - however, the forums Directory also has its own Application.cfm for alternate purposes.


Put the same redirect code in that application.cfm and you should be fine.
Sub Domains
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 2 of 2  

  
  
 Reply to topic