Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: .htaccess - How to properly redirect a domain?

  1. #1
    Shenron's Avatar
    Shenron is offline Administrator
    Join Date
    Dec 2008
    Location
    Portugal
    Posts
    1,900
    Blog Entries
    2
    Thanks
    561
    Thanked 548 Times in 368 Posts

    .htaccess - How to properly redirect a domain?

    Well, I've recently acquired a .org domain to redirect my .info

    palmbeachtravel(.)info >>> palmbeachtravel(.)org

    Now I need to get a proper redirect not to loose any traffic, rankings, bla bla... (bare in mind I get some good traffic from Google images that I don't want to waste)

    How can I do it using .htaccess ? (I believe it's the best way)

    Thx a lot!

  2. #2
    Mr.Bill's Avatar
    Mr.Bill is offline One is glad to be of service
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828
    Blog Entries
    1
    Thanks
    72
    Thanked 350 Times in 182 Posts
    Could use this 301 redirect
    Code:
    Options +FollowSymLinks 
    RewriteEngine on 
    RewriteCond {HTTP_HOST} ^(www\.)?domain2\.info [NC] 
    RewriteRule ^(.*)$ http://www.domain1.org/$1 [R=301,L]
    That will redirect requests for files in www.domain2.info or domain2.info to the same files in www.domain1.org

    Reverse IP Check ಠ_ಠ Proxy Sites
    <?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>

  3. Thanked by:

    Shenron (28 December, 2008)

  4. #3
    Shenron's Avatar
    Shenron is offline Administrator
    Join Date
    Dec 2008
    Location
    Portugal
    Posts
    1,900
    Blog Entries
    2
    Thanks
    561
    Thanked 548 Times in 368 Posts
    Coolness!
    So, that means that I only need to change domain1 and domain2 with palmbeachtravel and it'll work!

    (I really don't know s*it about .htaccess)

    Thx a lot mate!

  5. Thanked by:

    Jordan (7 January, 2009)

  6. #4
    Mr.Bill's Avatar
    Mr.Bill is offline One is glad to be of service
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828
    Blog Entries
    1
    Thanks
    72
    Thanked 350 Times in 182 Posts
    You got it

    Code:
    Options +FollowSymLinks 
    RewriteEngine on 
    RewriteCond {HTTP_HOST} ^(www\.)?palmbeachtravel\.info [NC] 
    RewriteRule ^(.*)$ http://www.palmbeachtravel.org/$1 [R=301,L]

    Reverse IP Check ಠ_ಠ Proxy Sites
    <?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>

  7. Thanked by:

    Jordan (7 January, 2009)

  8. #5
    Will.Spencer's Avatar
    Will.Spencer is offline Retired
    Join Date
    Dec 2008
    Posts
    5,033
    Blog Entries
    1
    Thanks
    1,010
    Thanked 2,327 Times in 1,258 Posts
    I have always wondered, is there an advantage to using mod rewrite over using redirect?

    Code:
    Redirect 301 /                                      http://www.example.com/
    Submit Your Webmaster Related Sites to the NB Directory
    I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.

  9. Thanked by:

    Jordan (7 January, 2009)

  10. #6
    Shenron's Avatar
    Shenron is offline Administrator
    Join Date
    Dec 2008
    Location
    Portugal
    Posts
    1,900
    Blog Entries
    2
    Thanks
    561
    Thanked 548 Times in 368 Posts
    That's my major question also, but I'm not sure Redirect allows me to keep my Google images traffic...

    /me tests later

  11. Thanked by:

    Jordan (7 January, 2009)

  12. #7
    Shenron's Avatar
    Shenron is offline Administrator
    Join Date
    Dec 2008
    Location
    Portugal
    Posts
    1,900
    Blog Entries
    2
    Thanks
    561
    Thanked 548 Times in 368 Posts
    Now this is weird...

    I had to use something like:

    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.palmbeachtravel.org/$1 [R=301,L]
    Otherwise it wouldn't work...

  13. Thanked by:

    Jordan (7 January, 2009)

  14. #8
    Jordan is offline Newbie Net Builder
    Join Date
    Dec 2008
    Posts
    59
    Blog Entries
    1
    Thanks
    83
    Thanked 8 Times in 5 Posts
    Ye i like useing 403 redirect or if you have cpanel just add a redirect in the control panel

  15. #9
    ari
    ari is offline Unknown Net Builder
    Join Date
    Dec 2008
    Posts
    9
    Thanks
    1
    Thanked 4 Times in 2 Posts
    Quote Originally Posted by Will.Spencer View Post
    I have always wondered, is there an advantage to using mod rewrite over using redirect?

    Code:
    Redirect 301 /                                      http://www.example.com/
    redirect is just aliased to mod_rewrite...

  16. #10
    hotdogtherapper is offline Unknown Net Builder
    Join Date
    Jan 2009
    Location
    santa monica, ca
    Posts
    5
    Thanks
    0
    Thanked 1 Time in 1 Post
    You should always use a 301 redirect. The problem with specifying each redirect instead of using regex is scalability. It's MUCH easier to make sure every URL is properly redirected with regex than it is to manually specify hundreds of URLs.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 7 September, 2010, 22:24 PM
  2. .htaccess All Page Redirect
    By ProxySites.ca in forum Managing
    Replies: 7
    Last Post: 28 May, 2010, 22:52 PM
  3. .htaccess / redirect to 'www.'
    By Snak3 in forum On-Site SEO
    Replies: 12
    Last Post: 30 December, 2009, 19:13 PM
  4. .htaccess help needed - dynanmic redirect
    By DomainMagnate in forum Programming
    Replies: 13
    Last Post: 27 September, 2009, 11:52 AM
  5. Domain Redirect
    By Riccur in forum Domaining
    Replies: 1
    Last Post: 13 July, 2009, 02:01 AM

Tags for this Thread

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
  •