how do I redirect http:// to http://www. with .htaccess?

Discussion in 'Google' started by jgjg, Jun 2, 2007.

  1. #1
    I want to redirect http:// to http://www. with .htaccess so that my PR doesn't get diluted between the 2.

    Can someone tell me the best way to do this that won't affect my domain with any side effects?
     
    jgjg, Jun 2, 2007 IP
  2. Fka200

    Fka200 Guest

    Best Answers:
    0
    #2
    (make sure to change YOURDOMAIN to your actual domain and TLD to your actual .net/.ws/.whatever tld)


    create a file called .htaccess with this:

    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^YOURDOMAIN\.TLD$ [NC]
    RewriteRule ^(.*)$ http://www.YOURDOMAIN.TLD/$1 [R=301,L]
    
    Code (markup):
    then ftp it into your main folder and you are good to go.
     
    Fka200, Jun 2, 2007 IP
    jgjg likes this.
  3. dhruv37

    dhruv37 Well-Known Member

    Messages:
    3,222
    Likes Received:
    195
    Best Answers:
    0
    Trophy Points:
    165
    #3
    Put the below code in .htaccess file (Change the domain name as per actual domain name)

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain\.com
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

    For more information you can read on - http://www.beyondink.com/howtos/301-redirect.html
     
    dhruv37, Jun 2, 2007 IP
    jgjg likes this.
  4. jgjg

    jgjg Peon

    Messages:
    595
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    got it working! thanks!

    reps++
     
    jgjg, Jun 2, 2007 IP
  5. massiva

    massiva Active Member

    Messages:
    699
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    78
    #5
    need to ask you guys,

    My site redirects from http://www to http:// for almost 1.5 months (don't ask me why pls. I had some problems with my host company.)

    Is it the reason for loosing SERP?

    I edit my .htaccess file, I upload it via FTP but without effect
     
    massiva, Jun 2, 2007 IP
  6. poksa

    poksa Banned

    Messages:
    314
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    poksa, Jun 2, 2007 IP
  7. oseymour

    oseymour Well-Known Member

    Messages:
    3,960
    Likes Received:
    92
    Best Answers:
    0
    Trophy Points:
    135
    #7
    what hosting company are you using?
     
    oseymour, Jun 2, 2007 IP
  8. massiva

    massiva Active Member

    Messages:
    699
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    78
    #8
    I've had a problems with subdomains. Basically if you were typed anything.domain.com it will shows the main site content. So I asked for corect the glitch and they redirect to http://...

    Could it be the reason for SERP decreasing?
    I try to redirect to http://www but without success.

    If anyone nows how to do that I'll give him my htaccess file. Just PM me.

    The company is at my sig.
     
    massiva, Jun 2, 2007 IP
  9. carl_in_florida

    carl_in_florida Active Member

    Messages:
    1,066
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    90
    #9
    It has been my experience that I get the biggest SERP hits when I stop updating my sites.
     
    carl_in_florida, Jun 2, 2007 IP
  10. trichnosis

    trichnosis Prominent Member

    Messages:
    13,785
    Likes Received:
    333
    Best Answers:
    0
    Trophy Points:
    300
    #10
    .htaccess is perfect way to redirect and some hosting providers like dreamhost is giving this service from their control panel.
     
    trichnosis, Jun 2, 2007 IP