Hey folks, I know this discussion of 301 redirects is a couple weeks old,
and that Ryan says he's solved the problem, but I don't recall anyone
bringing something that could be useful, if one's on CF8 (and I don't recall
Ryan saying if he is).

CFLOCATION now accepts the StatusCode as an attribute itself, so you can do
a 301 with CFLOCATION. It muddies the waters a bit, since for so long all
have associated CFLocation instantly as being a 302, as in this thread. Oh
well. It's Christmas. Consider it a new toy. :-) It's one of the 100+ hidden
gems I've chronicled in the talk I've given, "Hidden Gems in CF8", which I
intend to turn into a modestly priced half-day online course in the new
year.

More on this CFLOCATION STATUSCODE feature (other than the docs, of course)
is at:

http://www.petefreitag.com/item/648.cfm
http://www.coldfusionguy.com/ColdFusion/blog/index.cfm/2007/12/6/301-Redirec
ts-With-CFLocation-StatusCode-Attribute
http://www.coldfusionjedi.com/index.cfm/2007/6/7/Automatically-pushing-to-a-
new-URL-and-how-ColdFusion-8-makes-this-a-bit-simpler

More on the concept in general is also available at:
http://www.wrox.com/WileyCDA/Section/id-306460.html

Seriously, though, Merry Christmas to all.

/charlie

-----Original Message-----
From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Ryan Sabir
Sent: Monday, December 17, 2007 7:27 PM
To: 'cfaussie@googlegroups.com'
Subject: [cfaussie] Re: 301 redirect not changing URL [SOLVED]


Hi all,
 
Andrew here came up with the solution:
 
You need to write the header tag like this :

<cfheader statuscode="301" statustext="Moved
Permanently#Chr(13)##Chr(10)#Location:#newurl#">

All in one line. Now the redirect works.. and the URL changes.

Yippee!

________________________________

From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Rony Fayyad
Sent: Tuesday, 18 December 2007 11:10 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: 301 redirect not changing URL


You could also try running that snippet of code on  a different Coldfusion
instance and see if the issue still ocurrs - may be try it on your local
host or another dev box.
 
See if its a CF thing....

        ----- Original Message ----- 
        From: Ryan Sabir <mailto:[EMAIL PROTECTED]>  
        To: 'cfaussie@googlegroups.com' 
        Sent: Tuesday, December 18, 2007 10:48 AM
        Subject: [cfaussie] Re: 301 redirect not changing URL

         
        CFLOCATION is a 302 redirect. It tells the search engine that the
resource requested has been moved temporarily. A 301 redirect tells a search
engine that the resource has been moved permanently, so no longer look for
it at the original URL.
         
        At least that's how I understand how it works.
        
         
________________________________

        From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Blair McKenzie
        Sent: Tuesday, 18 December 2007 10:42 AM
        To: cfaussie@googlegroups.com
        Subject: [cfaussie] Re: 301 redirect not changing URL
        
        
        Is there any reason not to use cflocation? Does it not handle that
stuff?
        
        Blair
        
        
        On Dec 18, 2007 10:38 AM, Ryan Sabir <[EMAIL PROTECTED]> wrote: 
        

                Yeah but I want the redirect to be a "Moved Permanently"
rather than "Moved Temporarily". Its for a site that has changed its URL
structure.

________________________________

                From: cfaussie@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew Scott
                Sent: Tuesday, 18 December 2007 10:06 AM
                To: cfaussie@googlegroups.com
                Subject: [cfaussie] Re: 301 redirect not changing URL
                
                

                Try 302 instead.

                 

                
                
                Andrew Scott
                Senior Coldfusion Developer
                Aegeon Pty. Ltd.
                www.aegeon.com.au
                Phone: +613  9015 8628
                Mobile: 0404 998 273

                 

                 

                From: cfaussie@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Ryan Sabir
                Sent: Tuesday, 18 December 2007 9:59 AM
                To: 'cfaussie@googlegroups.com'
                Subject: [cfaussie] 301 redirect not changing URL

                 

                Heya, 

                 

                I'm doing a 301 redirect using CFHEADER like so:

                 

                <cfheader statuscode="301" statustext="Moved permanently">
                <cfheader name="Location" value="http://www.new-url.com";> 

                 

                The redirect correctly shows the new page content, but the
URL in the browser window is still the old URL. If I bookmark it, its
actually bookmarking the old URL. How can I do an SEO friendly redirect, and
change the URL as well?

                 

                thanks.

                 

                 

                

                        Ryan Sabir
                Technical Director
                
                p: (02) 9274 8030
                f: (02) 9274 8099
                m: 0411 512 454
                w: www.newgency.com <http://www.newgency.com/> 

                        

                        Newgency Pty Ltd
                Web | Multimedia | eMarketing
                
                115 Cooper St
                Surry Hills NSW 2010
                Sydney, Australia

                        

                 

                
                

                 






                
        







--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to