WordPress.org

Ready to get started?Download WordPress

Forums

301 redirect from one domain to another (5 posts)

  1. magdabis
    Member
    Posted 1 year ago #

    Hi

    I've moved my blog from one website to another and need to set up 301 redirect. No idea how to do it. Your help will be appreciated.

    Thanks
    Magda

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Nifty tool:

    http://www.generateit.net/mod-rewrite/

    That said, the 301 redirect needs to be present at former hosting account and this simple .htaccess rewrite rule covers a domain change (for example all posts/pages/tags/archives/etc. are the same only the domain has changed...

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

    Again, this rule is at OLD domain and of course we update above rule with actual url of new domain.

    http://www.webconfs.com/how-to-redirect-a-webpage.php

  3. kissmykitty
    Member
    Posted 1 year ago #

    @Seacoast Web Design - thank you so much for posting the .htaccess code. I have the same situation as magdabis posted about; it's great to find such a quick solution to making sure that any traffic to my blog's old location will automatically redirect to the new one. The .htaccess solution works like a charm!

  4. DYC - The Voice Of Generation
    Member
    Posted 6 months ago #

    you can simply put this code in the header.php of your theme. between <head> put code here </head> tags

    <?php
    /* Redirect to new domain, you can enter new domain address in place of {dreamyoucareer.com} */

    header("Location: http://dreamyourcareer.com/");

    /* Make sure that code below does not get executed when we redirect. */

    exit;
    ?>

  5. Sandip Patil
    Member
    Posted 6 months ago #

    Write code to .htaccess file

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags