Submit Your Article Forum Rules

Results 1 to 9 of 9

Thread: 301 permanent redirect on IIS: how to do it?

  1. #1
    Senior Member Emark2009's Avatar
    Join Date
    Oct 2005
    Posts
    221

    301 permanent redirect on IIS: how to do it?

    hi,
    i asked my hosting-provider to make a 301 permanent redirect from visitnatalbrazil.com to www.visitnatalbrazil.com and this for SEO-purpose.

    My hosting-provider says i'm the first one who ask him this..

    What is the best way to do this and can he charge me an extra cost for this?

  2. #2
    Senior Member ADAM Web Design's Avatar
    Join Date
    Dec 2003
    Posts
    2,172
    It's really quite simple.

    Your host would merely have to set up visitnatalbrazil.com as a new site and initially point it to the same folder as www.visitnatalbrazil.com .

    When they've done that, they need to visit the Properties of the visitnatalbrazil.com site, and click the Home Directory tab. There's an option there to redirect to a URL, which they would pick and type in http://www.visitnatalbrazil.com and check the "A permanent redirection for this resource" box.

    That's it.

    They can charge you for anything they want, and since this is non-standard they might. I can't say for sure, although it's about a two-minute job in IIS.

  3. #3
    Senior Member
    Join Date
    Apr 2004
    Posts
    309
    You should never need to redirect domain.com to www.domain.com.

    If domain.com is not appearing and www.domain.com is then your host has misconfigured your dns settings. Your dns settings should have an A record for both domain.com and www.domain.com

    Doing a dnsreport on your site throws up a lot more problems than a missing A record, you need to get your host to sort out their server, nameservers and dns, it is an absolute mess.

    http://www.dnsreport.com/tools/dnsre...atalbrazil.com
    "I have not failed. I have found 10,000 ways that don't work" - Thomas Edison.
    "The secret to creativity is knowing how to hide your sources" - Albert Einstein.

  4. #4

  5. #5
    Senior Member
    Join Date
    Apr 2004
    Posts
    309
    Quote Originally Posted by ADAM Web Design
    He might for SSL reasons.
    Only in the above misconfigured dns scenario.

    A properly configured domain will have A records for both the domain.com and the www.domain.com so even when using a secure cert https://domain.com and https://www.domain.com are exactly the same site and will serve the same security certificate.
    "I have not failed. I have found 10,000 ways that don't work" - Thomas Edison.
    "The secret to creativity is knowing how to hide your sources" - Albert Einstein.

  6. #6
    Senior Member Emark2009's Avatar
    Join Date
    Oct 2005
    Posts
    221
    is there a way to solve this with scripting? that way i don't need my host..

    i use ASP.

  7. #7
    Senior Member ADAM Web Design's Avatar
    Join Date
    Dec 2003
    Posts
    2,172
    Code:
    Dim Domain, URL
    Domain = Request.ServerVariables ("HTTP_HOST") ' Gets the domain name.
    URL = Request.ServerVariables ("URL") ' Gets the current URL.
    if InStr (Domain, "www") = 0 then
    	URL = "http://www." & Domain & URL ' Concatenates the URL to the domain
    	Response.Status = "301 Moved Permanently"
    	Response.AddHeader "Location", URL
    end if
    Response.Write Domain & URL ' You can remove this if you want.  This just adds a check at the end.
    That should do it.

    Try it here:

    http://searchenginefriendlylayouts.com/test_domain.asp (I intentionally removed the www).

  8. #8
    Senior Member Emark2009's Avatar
    Join Date
    Oct 2005
    Posts
    221
    Hello Adam,

    thanks for the script. i implemented it and it gives back the correct server header, without help of my host.

    just one remark:
    http://visitnatalbrazil.com redirects to http://www.visitnatalbrazil.com/index.asp and not to http://www.visitnatalbrazil.com/
    Is this OK regarding the passing through of linkpopularity to http://www.visitnatalbrazil.com/ ?

    thanks again for the help.

  9. #9
    Senior Member Emark2009's Avatar
    Join Date
    Oct 2005
    Posts
    221
    Quote Originally Posted by ADAM Web Design
    Code:
    Dim Domain, URL
    Domain = Request.ServerVariables ("HTTP_HOST") ' Gets the domain name.
    URL = Request.ServerVariables ("URL") ' Gets the current URL.
    if InStr (Domain, "www") = 0 then
    URL = "http://www." & Domain & URL ' Concatenates the URL to the domain
    Response.Status = "301 Moved Permanently"
    Response.AddHeader "Location", URL
    end if
    Response.Write Domain & URL ' You can remove this if you want. This just adds a check at the end.
    Can anyone give me exact the same code for PHP?

Similar Threads

  1. $3 permanent .....Really
    By dwiewebpro in forum Ad Space Buy and Sell
    Replies: 0
    Last Post: 06-11-2009, 12:22 AM
  2. When a "permanent" redirect is no longer permanent
    By xtempore in forum Search Engine Optimization Forum
    Replies: 15
    Last Post: 03-18-2009, 10:30 PM
  3. Permanent 301 Redirect Not Found? What does this mean?
    By rjjj111 in forum Search Engine Optimization Forum
    Replies: 2
    Last Post: 11-13-2008, 09:36 PM
  4. Permanent redirect
    By aidanfitz in forum Google Discussion Forum
    Replies: 1
    Last Post: 07-14-2006, 03:01 PM
  5. Should I use a permanent redirect?
    By blueharvest in forum Search Engine Optimization Forum
    Replies: 14
    Last Post: 11-29-2005, 11:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •