Redirecting non-WP URLs (2 posts)

  1. kgagne
    Posted 9 years ago #

    My old site uses static HTML files and folders. I would like to migrate its content to WordPress without breaking external sites that are linking to the old URLs.

    An example of an existing file is this:


    Under WordPress, that content will be slug "crzytaxi" in category "gcn", producing a new URL:


    But none of the permalink redirect plug-ins I've tried work to convert /%category%/%postname%.shtml to /%category%/%postname% , and I can't come up with an .htaccess RewriteRule that will accomplish what I want while jiving with WordPress's rules. Can anyone suggest a way to redirect my non-WP URLs (without creating hundreds of individual files redirecting each possible URL instance)?

    I've read this post and the link on it and ended up with this .htaccess file that does not redirect URLs ending in .shtml:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{query_string} ^\.shtml$
    RewriteRule ^(.*)\.shtml(/.*)? /$1$2 [R]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

  2. kgagne
    Posted 8 years ago #

    This question is answered here:


    Migration of my old site (500+ HTML files) to WordPress is complete! Thanks to all who made suggestions. The final product is at http://www.gamebits.net/

Topic Closed

This topic has been closed to new replies.

About this Topic