Redirects?

Discussion in 'Site & Server Administration' started by hitboy, Jun 7, 2007.

  1. #1
    im not sure if this is in the right section but I was wondering how do I redirect the url below to the url below it...

    www.subdomain.yourdomain.com

    Redirect to:

    subdomain.yourdomain.com

    Please help me as I have no clue how to do it.. thanks
     
    hitboy, Jun 7, 2007 IP
  2. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Put this in the .htaccess file at subdomain root.

    
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.subdomain\.domain\.com$ [NC]
    RewriteRule ^(.*)$ http://subdomain.domain.com/$1 [R=301,L]
    
    Code (markup):
     
    agnivo007, Jun 7, 2007 IP
  3. hitboy

    hitboy Well-Known Member

    Messages:
    2,939
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    170
    #3
    where do i place that code?
     
    hitboy, Jun 7, 2007 IP
  4. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What? Are you sure you read my previous post?
     
    agnivo007, Jun 7, 2007 IP
  5. hitboy

    hitboy Well-Known Member

    Messages:
    2,939
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    170
    #5
    yea i did i meant where exactly do I put it in the htaccess file..
     
    hitboy, Jun 7, 2007 IP
  6. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #6
    In the same folder as your home page index file.
     
    login, Jun 7, 2007 IP
  7. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #7
    inworx, Jun 8, 2007 IP
  8. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Cause some people have a habit of putting www in front of everything. ;)
     
    agnivo007, Jun 8, 2007 IP