htaccess help moving Expression Engine site to WordPress

I currently have an Expression Engine blog which I am going to move over to WordPress, the current url structure is /blog/comments/page-title

I have imported the posts into WordPress and I’m going to keep the same page title’s for the pretty urls but just want the address to be /page-title

Read More

the WordPress htaccess file is as follows

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

can anybody tell me how I do this additional redirect in this block? Also will this totally ensure that search engine indexing won’t be affected as it has been running for 4 years and I have over 1700 blog posts currently indexed.

Related posts

Leave a Reply

1 comment

  1. Put this before your WordPress rules in your .htaccess file:

    RedirectMatch ^/blog/comments/(.+)$ /$1 [R=301]

    This will redirect http://yourdomain.com/blog/comments/my-post to http://yourdomain.com/my-post, and tell search engines that the redirect is permanent.

    One note: WordPress discourages the use of /%postname%/ as a permalink structure as it adds many more queries to determine the content to load. From http://codex.wordpress.org/Using_Permalinks:

    Starting Permalinks with %postname% is strongly not recommended for performance reasons.

    So I’d suggest instead using something like /blog/%postname% instead, in which case your rule would look like:

    RedirectMatch ^/blog/comments/(.+)$ /blog/$1 [R=301]