mod_rewrite htaccess wordpress.org to wordpress.com

  • Author
    Posts
  • #51299

    andyhillky
    Member

    I’m not sure if this is the right place to ask, but I figure it’s worth a shot…

    I’m wanting to complete a move that I had from a site I hosted with wordpress.org to wordpress.com — to have all of my archive links redirect to the new site.

    wp.org software is installed here: example.com/wp/

    I’m using the http://www.example.com/wp/2007/01/21/sample-post/ hyperlinking in WP 2.0.2, so I tried this:

    ReWriteRule http://www.example.com/wp/(.*) http://bofe.wordpress.com/$1

    and I had no luck. Can anyone help?

    Thanks!

    #51442

    drmike
    Member

    Just for reference, wordpress.org doesn’t do hosting. (We’re trying to get folks not to say that as it’s causing confusion with other folks.) ‘You’re using the software from wp.org’ is what we’re suggesting. :)

    You do have RewriteEngine On in your htaccess file, right?

    IIRC, it should actually be:

    RewriteRule ^/wp/(.*) http://bofe.wordpress.com/$1 [QSA,L]

    I hate doing rewrite rules.

    #51446

    andyhillky
    Member

    drmike,

    thanks for the clarification. giving it a try…

    didn’t work.

    here’s my .htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteRule ^/wp/(.*) http://bofe.wordpress.com/$1 [QSA,L]
    </IfModule>
    # END WordPress

    the site i’m wanting to do this to is http://www.bofe.org/wp/

    #51450

    andyhillky
    Member

    also, just to let you know, with the suggested ReWriteRule, the old permalinks are giving me 404s.

    #51453

    drmike
    Member

    Where is this htaccess file in your directory structure anyway?

    If it’s in the wp subdirectory, edit out the ‘/wp’

    #51457

    andyhillky
    Member

    the .htaccess file is here: /bofe.org/wp/

    So the final look should be?…

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteRule ^/(.*) http://bofe.wordpress.com/$1 [QSA,L]
    </IfModule>
    # END WordPress

    #51458

    andyhillky
    Member

    still getting 404s. thanks so much for your help with this issue.

    #51493

    devblog
    Member

    bofe,

    If you haven’t figured it out yet, try this:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule (.*) http://bofe.wordpress.com/$1 [R=301,L]
    </IfModule>

    The only difference in my example is that I’m not using the circumflex nor the forward slash. Also, I’m using the R flag.

    I bet that the 404 error pages came up because the URL to your article on wordpress.com didn’t have the year section in the path. Something like this:

    http://bofe.wordpress.com/01/21/sample-post/

    when it should have read

    http://bofe.wordpress.com/2007/01/21/sample-post/

    If this is the case, the code above should fix your problem.

    If for some reason you still get a 404, try adding this line:

    RewriteBase /wp/

    so your rules will read like this:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wp/
    RewriteRule (.*) http://bofe.wordpress.com/$1 [R=301,L]
    </IfModule>

    I tested both forms and they worked for me.

    Hope this helps

    #51495

    drmike
    Member

    I was close. :)

    #51521

    andyhillky
    Member

    woohoo!

The topic ‘mod_rewrite htaccess wordpress.org to wordpress.com’ is closed to new replies.