Forums

Help needed redirecting old urls .htaccess/ReWriteRule (3 posts)

  1. Everton
    Member
    Posted 5 years ago #

    I'm trying to redirect my old blogware urls to my new WP blog that I'm setting up on a temporary site until I get the redirect sorted. I've wasted 4 hours and i'm not getting anywhere so any help appreciated!

    I'm trying to setup .htaccess so that it will redirect external links pointing to my old site, to the new corresponding page I'm building on your servers so that I don't lose any traffic.

    The old page structure is:

    http://domain/_archives/YYYY/M/D/uniqueref.html

    where M and D can be one or two digits depending on the month/day. I want any old url's to either the new article I've imported, or at least to the same post day i.e.

    (i) http://domain/YYYY/MM/DD/article title

    (ii)http://domain/YYYY/MM/DD

    I think (i) will be impossible so I've tried to crack (ii) by following these instructions http://comox.textdrive.com/pipermail/wp-hackers/2006-May/006337.html and at the moment my .htaccess file reads (my new temp domain is http:// siteground128.com/~connecte):

    # Make sure mod_rewrite is ready to go
    RewriteEngine On
    RewriteBase /
    # redirect URLs like /blog/_archives/2006/2/23/1780165.html to /2006/2/23/
    RewriteRule ^blog/_archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?http://siteground128.com/~connecte/$1/$2/$3/ [QSA,L]

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

    # END WordPress

    Please tell me what I'm doing wrong. Don't worry about telling me how stupid I am - I've got a very thick skin and I'm new to all this.

    thanks in advance for any help. Once I get this sorted I'll be able to move my nameservers over.

    Everton

  2. deko
    Member
    Posted 5 years ago #

    if you want everyone going to oldsite.com to be sent to newsite.com, you could use this:

    RewriteEngine on
    Options All -Indexes
    RewriteCond %{HTTP_HOST} ^www.oldsite.com$ [NC,OR]
    RewriteCond %{HTTP_HOST} ^oldsite.com$ [NC]
    RewriteRule ^(.*)$ http ://www.newsite.com/index.html

    (space goes on other side of http... )

    so, anyone who has a shortcut pointing to (or types in the address window) 'oldsite.com' will arrive at newsite.com

    is this what you're trying to do?

  3. Everton
    Member
    Posted 5 years ago #

    Almost ;-)

    What I'm trying to do is redirect anyone following an old link to the old blogware blog e.g to:
    http://www.connectedinternet.co.uk/blog/_archives/2006/5/31/1996518.html

    to the closest page on the new WordPress blog,the one showing posts on 5/31. If I can manage this at least they can scroll to the relevant post i.e.

    http://www.connectedinternet.co.uk/2006/05/31

    which I think is the best I can hope for as I don't think it will be possible to redirect users to the actual permalink (http://www.connectedinternet.co.uk/2006/05/31/one-to-watch-crowdstorm-social-shopping-20/)

Topic Closed

This topic has been closed to new replies.

About this Topic