Forums

Migrating from another blog engine, need advice with rewrite and redirects (2 posts)

  1. eduardosilva
    Member
    Posted 2 years ago #

    Greetings!

    I'm migrating from another blog engine to wordpress, actually at this time, the main part of my migration is complete, I'm just worried about 2 items:

    - Keeping my old links working... at the begining I was using /yyyy/mm/dd/post-title, then I switched to just /post-title (on my old blog) after migrating to wordpress, I'm still using /post-title but some old links to my blog, still point to the original format. I solved this using RewriteMatch 301

    RedirectMatch 301 /\b[1-9][0-9]{3}\b/[0-1][0-9]/[0-3][0-9]/(.*) http://example.com/$1

    (working fine)

    - Keeping feeds working - I'm trying to redirect the old feeds to wp feeds, but my Redirect Rule isn't working.

    Can you help me with this Rules? I think that my problem is to fit the "?" to the rule, I already tried some variations but it didn't worked at all.

    here is my .htaccess

    RedirectMatch 301 /\b[1-9][0-9]{3}\b/[0-1][0-9]/[0-3][0-9]/(.*) http://example.com/$1
    RedirectMatch 301 /?tempskin=_rss2 http://example.com/feed
    RedirectMatch 301 /?tempskin=_rss2 http://example.com/feed
    RedirectMatch 301 /?tempskin=_atom http://example.com/feed
    RedirectMatch 301 /?tempskin=_rss2&disp=comments http://example.com/comments/feed
    RedirectMatch 301 /?tempskin=_atom&disp=comments http://example.com/comments/feed

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

    # END WordPress

    I'm also planning to use the plugin "smart 404" to "fix" any broken link that I didn't noticed before.

    Any suggestions? Is it ok to redirect the feeds??

    thanks in advance

  2. eduardosilva
    Member
    Posted 2 years ago #

    Update:
    I changed my redirect rule to a more generic rule using *

    RedirectMatch 301 /*tempskin=_rss2 http://example.com/feed

    If I access my blog http://example.com/?tempskin=_rss2 the redirect will not work.

    If instead of the "?" insert any other character the redirect will work
    example:
    Access http://example.com/Btempskin=_rss2 will correctly redirect to http://example.com/feed
    A redirect for the feeds is my last adjustment that i need to switch from my old blog to wp.

    Any ideas?
    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.