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

How to 301 redirect all internal pages to homepage

Discussion in 'Black Hat SEO' started by hobokook, Aug 15, 2013.

  1. hobokook

    hobokook Newbie

    Joined:
    Aug 15, 2012
    Messages:
    23
    Likes Received:
    0
    When doing a 301 redirect, how do you redirect the homepage and all internal pages of one site to the homepage of another site?

    Can you do this in Cpanel?

    Thanks
     
  2. -Jericho-

    -Jericho- Jr. Executive VIP Jr. VIP Premium Member

    Joined:
    Jan 10, 2010
    Messages:
    2,849
    Likes Received:
    1,704
    Location:
    Stalking My Ex-Wife
    You do it in your .htaccess file.

    Code:
    
    RewriteEngine on 
    RewriteCond %{HTTP_HOST} old\.com$ 
    RewriteRule .* http://www.new.com/ [L,R=301]
    
    Open up your ftp for the site. You probably have an htaccess file in the root for the domain. Copy this into it with the correct domain names.
     
    • Thanks Thanks x 2
  3. dinkish

    dinkish Power Member

    Joined:
    Apr 19, 2013
    Messages:
    689
    Likes Received:
    159
    If you don't know how to use FTP you can do it within cPanel:

    Login to cPanel, Go to the File Manager, in your root directory you'll see the .htaccess file you can right click on this and go to Edit (if you don't have a .htaccess file, create a new file called ".htaccess" without quotes). From there you can edit it as Jericho mentioned above.
     
    • Thanks Thanks x 1
  4. supportnhelp

    supportnhelp Regular Member

    Joined:
    Mar 1, 2012
    Messages:
    367
    Likes Received:
    75
    Home Page: