WordPress.org

Ready to get started?Download WordPress

Forums

301 Redirect Old Domain to New with Different URLs (4 posts)

  1. timmelody
    Member
    Posted 11 months ago #

    Hello, any help with this problem would be greatly appreciated.

    Have migrated WP and all content from old domain to new.

    Right now we have exactly matching URLs e.g.

    olddomain/?p=369
    newdomain/?p=369

    So the easy .htaccess code to 301 the whole thing is

    RewriteEngine on
    RewriteRule ^(.*)$ http://www.newdomain.com $1 [R=301,L]

    Ok all very good, BUT I need to change the new domain urls to the SEF pretty permalinks, while at the same time preserving the (massive) SEO value from the old site. (If I change to pretty permalinks on the old domain, concerned about losing that.)

    So the question is, what is the best way to handle the old to new urls redirects e.g.

    olddomain/?p=369
    to
    newdomain/the-post-name

    Is there a simple RewriteRule I can use in the old site .htaccess file? And if so, what is it?

    Thanks for help!

  2. shamratdewan
    Member
    Posted 11 months ago #

    olddomain/?p=369
    to
    newdomain/the-post-name

    I don't think there is any automatic way for 301 like this. you need to change it manually (later is better then never...).

  3. timmelody
    Member
    Posted 11 months ago #

    Ok so if I do that, do I still need to add the

    RewriteEngine on
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

    and then each individual ulr after?

    Or do I simply add each indivdual url

    Redirect 301 /?p=369 http://www.newdomain.com
    Redirect 301 /?p=370 http://www.newdomain.com
    etc.
  4. shamratdewan
    Member
    Posted 11 months ago #

    you add each individual url...

Reply

You must log in to post.

About this Topic

Tags