• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

the correct code to implement 301 URL Redirection

Explorer ,
Nov 07, 2010 Nov 07, 2010

Copy link to clipboard

Copied

I have to permanently move a few pages, from http://www.site.com/page.cfm   to   http://www.site.com/new/page.cfm  but also to preserve page rank for each one of them. So, is this the correct code to implement 301 URL Redirection?

<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="
http://www.site.com/new/page.cfm">

also can I delete http://www.site.com/page.cfm  page after redirecting?

Views

477

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 07, 2010 Nov 07, 2010

Copy link to clipboard

Copied

I wouldn't pester CF with this sort of thing: it's a job for the web server.

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2010 Nov 07, 2010

Copy link to clipboard

Copied

Yes, that code looks fine to do a permanent redirect. You could also use CFLOCATION instead:

<cflocation url="..." statuscode="301">

Or, as Adam points out, you could do this through your web server's own native functionality if you chose.

I wouldn't recommend deleting the original page as long as references to that page's URL exist anywhere.

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

GSA Schedule, and provides the highest caliber vendor-authorized

instruction at our training centers, online, or onsite.

Read this before you post:

http://forums.adobe.com/thread/607238

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 08, 2010 Nov 08, 2010

Copy link to clipboard

Copied

LATEST

You could also use CFLOCATION instead:

yep but there is only one problem here, I am still running old CF MX 7 (plan to upgrade to CF 8 after new year ) and as far as I know statuscode is not supported in version 7. I'll try with IIS for now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation