RE: Detect a 301 redirect
| I'm curious, does one have to have a file name for get variables to work | correctly? | CFLOCATION URL=http://newDomain/newUrl.cfm?rd=oldUrl.cfm; | STATUSCODE=301 works fine | BUT | CFLOCATION URL=http://newDomain/?oldUrl=oldUrl.cfm; STATUSCODE=301 | does not. | Is there a standard reason for this? Is just for the 301 redirect. The latter case should work (test in your browser), but that may depend on your web server, and you have to have a default/index document in place. But - can't you look at the referrer, and if the referrer is in a list of outdated URLs - then you display a message? /H. -- Hugo Ahlenius - Hugo AhleniusE-Mail: hugo.ahlenius(at)nordpil.com Phone:+46 75 7575284 Nordpil Fax: +46 8 6747020 http://nordpil.com Mobile: +46 733 467111 Skype: callto:hugo.ahlenius vCard:http://nordpil.com/hugoahlenius.vcf - ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322218 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Detect a 301 redirect
Hugo Ahlenius wrote: But - can't you look at the referrer, and if the referrer is in a list of outdated URLs - then you display a message? That was my first thought but early testing did not show referrer showing anything earlier. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:35 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Detect a 301 redirect
Is there any easy way to detect that a page is being served because of a 301 redirect to it? We have reorganized some of our site so we have put 301 redirects in place for old URLs that people may use. But the powers that be do not want a completely silent redirect for users who may be using old bookmarks, published links, etc. They would like a message displayed asking them to update their sources. I thought a CGI variable might give me a hint, but I have not found the correct one if it exists. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322192 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Detect a 301 redirect
Well, a 301 redirect sort of means that the original file isn't there any more right. So that should be triggered via your 404 handler. You could intercept at that point and display message, along with the new location. andy -Original Message- From: Ian Skinner [mailto:h...@ilsweb.com] Sent: Tuesday, May 05, 2009 2:45 PM To: cf-talk Subject: Detect a 301 redirect Is there any easy way to detect that a page is being served because of a 301 redirect to it? We have reorganized some of our site so we have put 301 redirects in place for old URLs that people may use. But the powers that be do not want a completely silent redirect for users who may be using old bookmarks, published links, etc. They would like a message displayed asking them to update their sources. I thought a CGI variable might give me a hint, but I have not found the correct one if it exists. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322194 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Detect a 301 redirect
Andy Matthews wrote: Well, a 301 redirect sort of means that the original file isn't there any more right. So that should be triggered via your 404 handler. You could intercept at that point and display message, along with the new location. andy Not quite. We have the 301 redirects in place so no 404 errors are thrown. When you type in an old URL your browser gets a 301, and send you on the correct new location. This is all good in my mind. But some powers that be, say No, we must tell users they have been redirected What I was hoping for, but I am getting discouraged on finding, is a simple trigger where I can simply add a message to the page say something like You came from zzz which now lives at yyy, please update your information. when such a redirect occurs. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322195 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Detect a 301 redirect
Ian: You could append a URL variable to the redirect URL that indicates the URL the redirect came from. In other words, something like: CFLOCATION URL=newUrl.cfm?oldUrl=oldUrl.cfm STATUSCODE=301 The new page would simply have to check for the oldUrl variable in the URL scope. -- Mosh Teitelbaum evoch, LLC http://www.evoch.com/ Ian Skinner wrote: Is there any easy way to detect that a page is being served because of a 301 redirect to it? We have reorganized some of our site so we have put 301 redirects in place for old URLs that people may use. But the powers that be do not want a completely silent redirect for users who may be using old bookmarks, published links, etc. They would like a message displayed asking them to update their sources. I thought a CGI variable might give me a hint, but I have not found the correct one if it exists. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322197 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Detect a 301 redirect
Perhaps your users could land on the original page, which displays a message telling them they are being redirected, then after 5 seconds (or whatever) the 301 redirect kicks in and moves them to the new page. This could easily be done with a cfheader/sleep/cflocation combo. Thanks, Eric Cobb Certified Macromedia ColdFusion MX 7 Developer http://www.cfgears.com Ian Skinner wrote: Andy Matthews wrote: Well, a 301 redirect sort of means that the original file isn't there any more right. So that should be triggered via your 404 handler. You could intercept at that point and display message, along with the new location. andy Not quite. We have the 301 redirects in place so no 404 errors are thrown. When you type in an old URL your browser gets a 301, and send you on the correct new location. This is all good in my mind. But some powers that be, say No, we must tell users they have been redirected What I was hoping for, but I am getting discouraged on finding, is a simple trigger where I can simply add a message to the page say something like You came from zzz which now lives at yyy, please update your information. when such a redirect occurs. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322200 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Detect a 301 redirect
CF matters aside, isn't anything but a silent, server-side redirect going to do very very bad things to your SEO and existing link placement? -- -...@robertson-- Janitor, The Robertson Team mysecretbase.com ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322201 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Detect a 301 redirect
Mosh Teitelbaum wrote: Ian: You could append a URL variable to the redirect URL that indicates the URL the redirect came from. In other words, something like: CFLOCATION URL=newUrl.cfm?oldUrl=oldUrl.cfm STATUSCODE=301 I thought of that idea but I have not got it to work yet. OK, I just tried your code and it works fine! I didn't know the cflocation tag had been updated to allow one to send an HTTP Status other then 302 temporary relocation. I'm curious, does one have to have a file name for get variables to work correctly? CFLOCATION URL=http://newDomain/newUrl.cfm?rd=oldUrl.cfm; STATUSCODE=301 works fine BUT CFLOCATION URL=http://newDomain/?oldUrl=oldUrl.cfm; STATUSCODE=301 does not. Is there a standard reason for this? Is just for the 301 redirect. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322203 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Detect a 301 redirect
Do you know what one of these pages is? Maybe you could do a GetHttpRequestData() call and introspect the headers key of the return struct. Maybe something there will give you what you need. Steve Cutter Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer Co-Author of Learning Ext JS http://www.packtpub.com/learning-ext-js/book _ http://blog.cutterscrossing.com Ian Skinner wrote: Andy Matthews wrote: Well, a 301 redirect sort of means that the original file isn't there any more right. So that should be triggered via your 404 handler. You could intercept at that point and display message, along with the new location. andy Not quite. We have the 301 redirects in place so no 404 errors are thrown. When you type in an old URL your browser gets a 301, and send you on the correct new location. This is all good in my mind. But some powers that be, say No, we must tell users they have been redirected What I was hoping for, but I am getting discouraged on finding, is a simple trigger where I can simply add a message to the page say something like You came from zzz which now lives at yyy, please update your information. when such a redirect occurs. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322198 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Detect a 301 redirect
Well, a 301 redirect sort of means that the original file isn't there any more right. So that should be triggered via your 404 handler. You could intercept at that point and display message, along with the new location. andy Is there any easy way to detect that a page is being served because of a 301 redirect to it? We have reorganized some of our site so we have put 301 redirects in place for old URLs that people may use. But the powers that be do not want a completely silent redirect for users who may be using old bookmarks, published links, etc. They would like a message displayed asking them to update their sources. I thought a CGI variable might give me a hint, but I have not found the correct one if it exists. The GetHttpRequestData is designed to get header information and the numeric code returned. There is an example of it working in the CFMX 7 livedocs site: http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentationfile=0482.htm If that does not meet your needs. The other way I know of getting that type of info would be through a Servlet. If you either feel adventurous or are pretty decent with Java you could code a custom tag in Java. If I remember correctly, the custom tag uses both the http request and response methods, between the two you should be able to get the custom tag to return whatever code you are looking for. --JW ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322204 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Detect a 301 redirect
Can't remember, are you using IIS or Apache? I know that in Apache you can define an actual file for each specific server code. So you could have a 301.cfm which gets registered in the web server. That file gets triggered any time the server returns that error. I would assume that IIS has the same mechanism. Maybe that would work for you? andy -Original Message- From: Ian Skinner [mailto:h...@ilsweb.com] Sent: Tuesday, May 05, 2009 3:14 PM To: cf-talk Subject: Re: Detect a 301 redirect Andy Matthews wrote: Well, a 301 redirect sort of means that the original file isn't there any more right. So that should be triggered via your 404 handler. You could intercept at that point and display message, along with the new location. andy Not quite. We have the 301 redirects in place so no 404 errors are thrown. When you type in an old URL your browser gets a 301, and send you on the correct new location. This is all good in my mind. But some powers that be, say No, we must tell users they have been redirected What I was hoping for, but I am getting discouraged on finding, is a simple trigger where I can simply add a message to the page say something like You came from zzz which now lives at yyy, please update your information. when such a redirect occurs. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322212 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4