WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Dynamic MT 3.2 content with underscores in URL to WP 2.1 with dashes (2 posts)

  1. djblurb
    Member
    Posted 7 years ago #

    My Movable Type powered site was dynamically generated. That means no static files. So none of the older MT plugins or tutorials work. MT used underscores in the URL structure, and since I've successfully migrated the content to WP (and mapped the URL structure, except that the WP content uses dashes in the URL), I'd like to have a redirect/mod_rewrite directive that changes the underscores in the incoming URL request and replaces them with dashes so the correct WP content can be served.

    I'd like to use htaccess to accomplish this for search engine reasons. I suppose I could hack something up for the index.php for WP to handle, but it seems like best practice would be to use mod_rewrite.

    I'm currently using:

    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteBase /
    
    RewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ $1-$2-$3-$4-$5-$6 [R=301,NC]
    RewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ $1-$2-$3-$4-$5 [R=301,NC]
    RewriteRule ^([^_]*)_([^_]*)_([^_]*)_(.*)$ $1-$2-$3-$4 [R=301,NC]
    RewriteRule ^([^_]*)_([^_]*)_(.*)$ $1-$2-$3 [R=301,NC]
    RewriteRule ^([^_]*)_(.*)$ $1-$2 [R=301,NC,L]
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
  2. djblurb
    Member
    Posted 7 years ago #

    Solved this by moving the code that is above the WordPress code to an htaccess file in the /archives/ directory. I also had to build static files and use a file that replaced my Movable Type Individual Entry Archive.

    Seems to be working. We'll see if Google catches up.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.