How to forward an entire site to one URL

Discussion in 'HTML & Website Design' started by offthedome, Sep 5, 2013.

  1. #1
    I can't quite find the correct instructions ... I don't want to go and replace every single html page in a site with a 301 redirect. I just want too put one .htaccess file in the base folder and forward all of that traffic to one page. How do I do that?
     
    offthedome, Sep 5, 2013 IP
  2. jamjar919

    jamjar919 Well-Known Member

    Messages:
    332
    Likes Received:
    7
    Best Answers:
    5
    Trophy Points:
    180
    #2
    Add this line to your .htaccess file in the root of your web directory.

    Redirect 301 / http://example.com/
     
    jamjar919, Sep 5, 2013 IP
  3. Endurint

    Endurint Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www.yourdomain.com$ [NC]
    RewriteCond %{HTTP_HOST} ^yourdomain.com$ [NC]
    RewriteRule ^(.*) http://www.yourdomain.com/yourpage.html [L,R=301]
    Code (markup):
     
    Endurint, Sep 5, 2013 IP
  4. Blesta.Store

    Blesta.Store Active Member

    Messages:
    97
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    80
    #4
    Endurint had one way or if your using cPanel do a redirect / to the page url or folder.

    Domains > Redirect > Add Redirect 301:

    (Domain name) / [keep the next box blank]

    redirects to→ to the page url you wish to redirect.
     
    Blesta.Store, Sep 8, 2013 IP
  5. Tim Gallant Creative

    Tim Gallant Creative Member

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #5
    Just be aware that using a one-line redirect for your whole site will lose you all the page ranking previously accrued. Instead, you should specify each page and its new destination in your .htaccess file.
     
    Tim Gallant Creative, Sep 8, 2013 IP