1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help Re: Redirects & htaccess

Discussion in 'HTML & JavaScript' started by Laubster, Oct 30, 2014.

  1. Laubster

    Laubster Senior Member Premium Member

    Joined:
    May 21, 2013
    Messages:
    1,008
    Likes Received:
    379
    Occupation:
    Self employed
    Location:
    I Travel A Lot
    Home Page:
    Hey everyone. My GF wants to transfer her WP site from www.domains.com (plural) to another domain she owns: www.domain.com (singular). I know how to clone sites, but don't quite understand how to do this so that all the old URL's points to the new URL's. Can I edit the htaccess file on the old site so that all URL's are 301'd to the new site properly? And if so, can you copy/paste the code here or point me in the right direction please?
     
  2. Conor

    Conor Jr. VIP Jr. VIP

    Joined:
    Nov 7, 2012
    Messages:
    3,538
    Likes Received:
    5,856
    Gender:
    Male
    Location:
    South Africa
    Home Page:
  3. domainingin

    domainingin Regular Member

    Joined:
    Oct 8, 2014
    Messages:
    429
    Likes Received:
    184
    Occupation:
    Domainer
    Location:
    Seychelles
    Home Page:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
     
    • Thanks Thanks x 1
  4. marketinglegalz

    marketinglegalz Newbie

    Joined:
    Oct 30, 2014
    Messages:
    7
    Likes Received:
    1
    As domaininin sets out, you may in future want to do a quick google search as the answer is already there.
     
  5. Repulsor

    Repulsor Power Member

    Joined:
    Jun 11, 2013
    Messages:
    766
    Likes Received:
    275
    Location:
    PHP Scripting ;)
    Are you talking about the urls as a whole? I mean once you clone the site and install it at the new domain the site will work perfectly other than all the links that was hyperlinked manually.

    I dont know if htaccess is the right way to deal with it but replacing all instances of old url with the new url in the database will solve it out.
     
  6. Aty

    Aty Jr. VIP Jr. VIP

    Joined:
    Jan 27, 2011
    Messages:
    5,957
    Likes Received:
    4,068
    Home Page: