WordPress.org

Ready to get started?Download WordPress

Forums

mod_rewrite rule to redirect SquareSpace URLs to WordPress URLs (2 posts)

  1. monicashaw
    Member
    Posted 3 years ago #

    I just moved my blog from a hosted page on SquareSpace to a WordPress install on my web host. The import was easy, but I'm now facing the thorny problem of permalinks.

    In my case, Squarespace's permalink structure is as follows:

    http://example.com/blog/2011/01/01/a-blog-post.html

    I want to redirect these to

    http://example.com/2011/01/01/a-blog-post/

    Can someone help me with a mod_rewrite rule to do this?

    Thank in advance,

    Monica

  2. trevorcooperphotography
    Member
    Posted 2 years ago #

    Modify the .htaccess in your web root adding the line...

    RewriteRule ^(.+).html$ $1 [L,NC,R=301]

    ...so that the file looks something like the following...

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^(.+).html$ $1 [L,NC,R=301]
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    You may have other lines as well. Mine is pretty vanilla but this is working for me.

    Here is a sample URL... San Elijo Lagoon Wildlife | Trevor Cooper Photography

    Hope it works for you as well.

    Trevor

Topic Closed

This topic has been closed to new replies.

About this Topic