Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2010
    Posts
    897
    Plugin Contributions
    0

    Default Use 301 redirects to forward old site to new

    Hi!

    I'm writing for 2 reasons. First is to share something I think is really cool. Second is to see if anyone can add to it.

    Ok, what I figured out is how to put a 301 redirect into my htaccess file that would redirect the entire site to a new domain. Simply open the htaccess file and, at the top, put in the following single line:

    Code:
    redirect 301 / http://www.NEWsite.com/
    Just like that you are done! This will create search engine friendly URL redirects. If you have to move domains and you want to keep your google rankings, this is the way to go!

    This is what will happen:
    www.OLDsite.com/category_I_want_to_keep
    ~301 redirected to~
    www.NEWsite.com/category_I_want_to_keep

    www.OLDsite.com/productURL_I_want_to_keep
    ~301 redirected to~
    www.NEWsite.com/productURL_I_want_to_keep

    Obviously your sites have to be structured the same. I use Ceon URI and SitemapXML. The only thing that changed was my domain name, so this worked beautifully.

    Hope this helps!
    Mike

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Use 301 redirects to forward old site to new

    This is also a good technique for the situation where you move your Zen Cart on the same server, such as from a subfolder to the root.

  3. #3
    Join Date
    Apr 2010
    Posts
    897
    Plugin Contributions
    0

    Default Re: Use 301 redirects to forward old site to new

    Oh... how to improve this?

    I would like my entire site to 301 redirect, EXCEPT the index.php and the /About_Us page. This site is now owned by a different company and they want no affiliation with the old.... except the well ranked links.

    In fact, I would like to put up a index.html file so that if somebody comes to www.OLDsite.com, they will see the message on my index.html.

    Can somebody maybe explain how to add some exceptions to the htaccess rule above?

    Thanks,
    Mike

  4. #4
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

    Default Re: Use 301 redirects to forward old site to new

    Hi,

    You could probably use:

    Code:
    RewriteEngine On
     
    RewriteCond !^/index.html$ [NC]
    RewriteCond !^/index.php$ [NC]
    RewriteCond !^/About_us [NC]
     
    RewriteRule .* http://www.NEWsite.com/ [QSA,L]
    This isn't really my area though.. just helping because you asked. :)

    All the best...

    Conor
    ceon

  5. #5
    Join Date
    Apr 2010
    Posts
    897
    Plugin Contributions
    0

    Default Re: Use 301 redirects to forward old site to new

    Thanks Conor.

 

 

Similar Threads

  1. v153 Changed my store folder and now my site redirects to the old one!
    By rrdein in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 11 Dec 2014, 10:42 AM
  2. 301 Redirects Not Working Fully
    By Higherthan in forum General Questions
    Replies: 9
    Last Post: 3 Dec 2012, 11:05 PM
  3. redirects to old domain name.Can't see new products online,only in new admin
    By mitdrissia in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 11 Dec 2009, 09:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR