Reply to topic
Re: JAMIE
jamie
HostMySite Sales Rep
HostMySite Sales Rep

Joined: 19 Mar 2004
Posts: 766
Location: Newark, De
Reply with quote
dgalfano wrote:
I have a need for a subdomain, strictly for testing purposes. I set up the domain: testing.domainname.com, but I was told that I need to provide a re-direct script. Can you post a sample so I can get an idea? Thanks,

Dan


What language would you like it in? There are several samples in this forum for CGI, ASP, and CF if I recall.
Got one
dgalfano


Joined: 11 Oct 2004
Posts: 55
Location: West Chester, PA - USA
Reply with quote
Hi Jamie,

Thanks for replying. I was able to figure it out. I was using the wrong key words when searching, but I found one that works.

Thanks,

Dan
Citizen1200


Joined: 07 Jul 2004
Posts: 54
Location: San Diego
Reply with quote
I'd be interested in seeing the redirect code for CF. Smile
bobclingan
Forum Regular

Joined: 16 Sep 2004
Posts: 271
Location: Abingdon, MD
Reply with quote
All you should need to do is do a re-direct based off the cgi.http_host variable right?
Citizen1200


Joined: 07 Jul 2004
Posts: 54
Location: San Diego
Reply with quote
beats me.
Govogi


Joined: 09 Sep 2006
Posts: 1
Location: USA
Reply with quote
Great information
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 548
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: 548
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