WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Dynamic MT 3.2 content with underscores in URL to WP 2.1 with dashes

[Resolved] Dynamic MT 3.2 content with underscores in URL to WP 2.1 with dashes

  • 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
    
Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Dynamic MT 3.2 content with underscores in URL to WP 2.1 with dashes’ is closed to new replies.