WordPress.org

Ready to get started?Download WordPress

Forums

Redirecting non-WP URLs (2 posts)

  1. kgagne
    Member
    Posted 6 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:

    http://www.gamebits.net/gcn/crzytaxi.shtml

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

    http://www.gamebits.net/gcn/crzytaxi

    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]
    </IfModule>

    # END WordPress

  2. kgagne
    Member
    Posted 6 years ago #

    This question is answered here:

    http://wordpress.org/support/topic/100642?replies=8#post-654277

    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