Here's what I do to force traffic onto the same domain so Google is happy:

...taken from where I set my application vars ...
<cfset application.FQDN = "www.foo.com">
/...

...this is inside of /Application.cfm

<cfif compareNoCase(cgi.server_name,application.AMPro.FQDN)>
        <cfif Len(Trim(cgi.query_string)) gt 0>
                <cfset variables.QueryDelim="?">
        <cfelse>
                <cfset variables.QueryDelim="">
        </cfif>
        <cfif not CompareNoCase(cgi.https,"ON")>
                <cfset variables.HTTPData="https://";>
        <cfelse>
                <cfset variables.HTTPData="http://";>
        </cfif>
        <cfif not Compare(cgi.server_port,"80")>
                <cfset variables.ServerPort="">
        <cfelse>
                <cfset variables.ServerPort=":" & cgi.server_port>
        </cfif>
    <cfset variables.newURL=variables.HTTPData & application.FQDN &
variables.ServerPort & cgi.script_name & variables.QueryDelim &
cgi.query_string>
    <cfif not compareNoCase(right(cgi.script_name,10),"/index.cfm")>
        <cfset variables.newURL=replaceNoCase(variables.newURL,"index.cfm","")>
    </cfif>
    <cfheader statuscode="301" statustext="Moved permanently">
    <cfheader name="Location" value="#variables.newURL#">
</cfif>

What it does is check to see if the domain is what its supposed to be.
 If it isn't, the url is dissected and reassembled, this time using
the correct domain.  Additionally, it also looks for any url with an
'index.cfm' in it.  Google doesn't like to see links to both

http://www.foo.com/index.cfm

and

http://www.foo.com/

so this eliminates that 'duplicate' url.

All of this has to be done in conjunction with matching link coding
throughout your site.  It won't help (and I am sure it would hurt) to
do this if your own links aren't written properly.  As in you
consistently use the proper fully qualified domain name, and your
links to your home page never use 'index.cfm'.

-- 
--m@Robertson--
Janitor, The Robertson Team
mysecretbase.com

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

Reply via email to