I would do this at the server level.. use URL rewrite. I know there is a URL
rewrite modules for IIS7, not sure about 6 though.

Jacob

-----Original Message-----
From: Che Vilnonis [mailto:[email protected]] 
Sent: Thursday, June 03, 2010 8:07 AM
To: cf-talk
Subject: CF & Domain Redirects


Here is the scenario. I own a domain. Call it domain.com. I also own an
often misspelled version, domains.com. Note the extra 's'.
I'd like to have domain.com automatically redirect to www.domain.com.
I'd also like have the www.domains.com or domains.com automatically redirect
to www.domain.com.
I'm using IIS6.

Anyway, I'm using the following code in onSessionStart:

<!--- domain redirects. --->
<cfif cgi.server_name eq "http://domain.com"; or cgi.server_name contains
"domains.com">
        <cfheader statuscode="301" statustext="Moved permanently">
        <cfheader name="Location" value="http://www.domain.com";> </cfif>

It seems to work. But I have a few questions.

1. Is onSessionStart the best place to put this code?
2. Should I be doing this type of redirect in IIS 6 instead of CF? If so,
how?
3. Are the any search engine related "penalties" to doing any of these
redirects?

Thanks, Che





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334275
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to