ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Migrating URLs from ColdFusion

March 10, 2009 4:57pm

Subscribe [2]
  • #1 / Mar 10, 2009 4:57pm

    DavidB

    11 posts

    I’m replacing a ColdFusion website with an EE site and wish to ensure that existing external links to ColdFusion pages are automatically redirected properly. For example, I wan’t an existing link like this:

    http://www.domain.com/index.cfm?fuseaction=artist&artist=131

    To return a specific category URL like this:

    http://www.domain.com/index.php/artists/illustrator/illustrator-name/

    I would like to hard code each ColdFusion URL, telling it which new EE URL to point to. Is there a way of doing this by placing an index.cfm file on my server with some PHP in? This would be similar to the ‘What about other files?’ info listed here:

    http://expressionengine.com/docs/installation/pmachine_migration.html

    I’m not a PHP expert and really appreciate any advice anyone can give!

  • #2 / Mar 10, 2009 5:54pm

    MeanStudios

    335 posts

    It looks like this is a job for an htaccess file.  Try looking here to see if you can write this yourself: http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/#redirects.  If you need any help, I can guide you along 😊.

  • #3 / Apr 29, 2009 12:55pm

    DavidB

    11 posts

    Thanks for the tip. I actually had some help from the fantastic support staff at EngineHosting (where the site is hosted) and we finally came up with a solution. This is a dummy version of the code we added to the .htaccess file:

    # initialize and enable rewrite engine
    RewriteEngine on
    
    # redirect files and directories
    
    RewriteCond %{QUERY_STRING} ^fuseaction=artist&artist=131 [NC] 
    RewriteRule ^index.cfm$ <a href="http://www.domain.com/index.php/artists/illustrator/illustrator-name/">http://www.domain.com/index.php/artists/illustrator/illustrator-name/</a>? [R=301,L]

    Obviously I used the correct URL details, not the dummy URL above. I repeated the redirection instruction for each individual page that needed redirecting.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases