Forums

MT to WP migration htaccess redirect issue (1 post)

  1. sarah semark
    Member
    Posted 5 months ago #

    I'm migrating a rather large (5000+ posts) from Movable Type to WordPress. At this point, I'm stuck trying to ensure that old post urls won't be result in 404s once we go live with the new site.

    The old url pattern looks like so:

    http://domain.com/site/category/category/post_name.php

    And I'd like to redirect those to

    http://domain.com/category/category/post_name/

    However, I have tried and tried with htaccess redirects, and no matter what I do, it either fails or generates a 500 error. I suspect I'm missing something silly, or that there are conflicting rules maybe, and I'm hoping that someone who knows htaccess better than I do can help me along the right path.

    Here's what I've got right now. The rule redirecting /site/ to the root directory works just fine, but the other two have no effect, whether alone or together. I tried both to see if I could redirect a specific post and do it manually that way, but it still won't work.

    RewriteEngine On

    RewriteRule ^site/(.*) /$1 [NC]
    RewriteRule ^site/resources/(.*).php$ /resources/$1 [NC]
    RewriteRule ^site/resources/research/safe_urban_form_revisiting_the_relationship_b.php$ /resources/research/safe_urban_form_revisiting_the_relationship_b/ [NC]

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Any help would be extremely useful!

Reply

You must log in to post.

About this Topic