That works great with ColdFusion. The OP however, is dealing with NON ColdFusion pages.
Also, ColdFusion 8 and up added statusCode to the cflocation tag. Wil Genovese Sr. Web Application Developer/ Systems Administrator CF Webtools www.cfwebtools.com [email protected] www.trunkful.com On May 5, 2011, at 5:55 PM, Jenny Gavin-Wear wrote: > > I came across this: > > HTTP 301 Redirect in ColdFusion > > <CFHEADER statuscode="301" statustext="Moved Permanently"> > <CFHEADER name="Location" value="http://www.somacon.com/"> > > I'd be interested in what everyone thinks about using the above, I've always > used the meta way before. > > I'm also thinking it might be a good idea to leave the meta keywords, site > description and page title tags in the old page? > > > -----Original Message----- > From: Chris Bracciano [mailto:[email protected]] > Sent: 05 May 2011 20:05 > To: cf-talk > Subject: CF 301 Redirect on an HTML page > > > > Hello all- > I have a rather strange request. I have old web pages that Google is still > finding links for so I want to utilize this power. These old links have new > equivalents. The problem is, the old links are so old that they are .htm > files. My site is now CF8 hosted. Doing a simple 301 redirect is proving > quite difficult. > > The complications: > I am on a shared server, so I don't have access to .htaccess. That option is > gone for a redirect. I tried to put <cflocation> tags on the old links, but > because they are .htm files, the server won't execute the <cflocation> tags. > I asked the server to tell CF to process all .htm extensions as .cfm, but > they can't do this because it's a shared server and it could cause problems. > > So, I tried to put the following code in my application.cfm file. > > <cfif #CGI.SCRIPT_NAME# EQ "old-page.htm"> > <cflocation url="new-page.cfm" addToken="yes" statusCode="301"></cfif> > > However, this doesn't seem to be working either. I think because the old > links are .htm files, application.cfm isn't even running when I attempt to > go to the old links and test the code. > > Any thoughts? Thanks in advance. > -Chris > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:344289 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

