Dns 301

Discussion in 'Programming' started by n971, Feb 13, 2007.

  1. #1
    Hello,

    Does anyone knows if it is possible to gain permanent redirect (301) with proper DNS settings (a, cname...) from a non www to www site.

    I have a website which SE see as a two sites with and without www. I want it like this: you enter google.com and browser instantly change it to www.google.com.


    TIA
     
    n971, Feb 13, 2007 IP
  2. Munk

    Munk Peon

    Messages:
    56
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't think you'd do it with DNS but you could do it with mod_rewrite.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
    RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
    Code (markup):
     
    Munk, Feb 14, 2007 IP
  3. n971

    n971 Well-Known Member

    Messages:
    236
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    123
    #3
    I forgot to say that server is MS.
     
    n971, Feb 15, 2007 IP
  4. Munk

    Munk Peon

    Messages:
    56
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I take it you mean IIS (as Apache runs on Windows too). In that case ... I'm not going to be able to help, sorry. If you're new to all this and you don't have reason not to - I would suggest trying out Apache though.
     
    Munk, Feb 15, 2007 IP
  5. n971

    n971 Well-Known Member

    Messages:
    236
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    123
    #5
    Yes, IIS. I'm using win servers because I can do ASP, and can't do PHP.
     
    n971, Feb 15, 2007 IP
  6. Munk

    Munk Peon

    Messages:
    56
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I see - well there must be a way in ASP to throw out the 301 redirect headers. Yeah google "asp 301" and you should find your solution.
     
    Munk, Feb 16, 2007 IP
  7. n971

    n971 Well-Known Member

    Messages:
    236
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    123
    #7
    Ok, thanks anyway...
     
    n971, Feb 17, 2007 IP
  8. Munk

    Munk Peon

    Messages:
    56
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks anyway? It's your first google result my friend. :)

    http://www.seoconsultants.com/tips/asp/301.asp

    But if you're too busy to click that link,

    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location", "http://www.seoconsultants.com/new-page.asp"
    %>
    Code (markup):
    :D
     
    Munk, Feb 17, 2007 IP
  9. Munk

    Munk Peon

    Messages:
    56
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Uh, wait - I'm a jackass. That doesn't solve your problem and neither does my previous post ... not exactly at least. I'm not super-familiar with IIS ... but unless you were able to setup different virtual domains (one for www.your-domain.com and one for your-domain.com) my solution isn't really a solution.

    Do you know if you can setup those virtual domains?

    Also ... I see there are "mod_rewrite" implementations for IIS. Google "iis mod_rewrite" ... are you running your own server or hosted?
     
    Munk, Feb 17, 2007 IP
  10. n971

    n971 Well-Known Member

    Messages:
    236
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    123
    #10
    I know about that asp solution, I do it for particular pages, after I delete some page ie, I put that. But that is not what I wanted.
    Re the hosting, I have some on virtual dedicated, some on shared (godaddy).

    My problem raised after I moved to godaddy. Befere that, google see my site as one, after I moved to godaddy, my www example com has a PR4 as before, and without www it has PR0, it was not the case. And all my internal pages droped to PR0.
    Now, I can do this in google webmaster tools, I know, but what about other SE?
     
    n971, Feb 17, 2007 IP
  11. Munk

    Munk Peon

    Messages:
    56
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Munk, Feb 17, 2007 IP