domainname.com TO www.domainname.com

Discussion in 'Site & Server Administration' started by hasitruparel, May 10, 2006.

  1. #1
    i am using win 2003 server, i want to redirect domainname.com's all pages to www.domainname.com relevant page.

    please advice how i can do the same.

    thanks, hasit
     
    hasitruparel, May 10, 2006 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    digitalpoint, May 10, 2006 IP
  3. hasitruparel

    hasitruparel Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i have a windows server, the link is for apache server
     
    hasitruparel, May 10, 2006 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Oh yeah... sorry, missed that part. No idea how to do it on Windows.
     
    digitalpoint, May 10, 2006 IP
  5. seojunkie

    seojunkie Banned

    Messages:
    54
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you have admin access to the IIS server, follow the steps below:

    1. Start Internet Services Manager. Alternatively, start the IIS Snap-in in Microsoft Management Console (MMC).

    2. Click to expand * server name, where server name is the name of the server.

    3. Right-click either the Web site or the folder that you want to redirect, and then click Properties.

    4. Click one of the following tabs that is appropriate to your situation:

    • Home Directory
    • Virtual Directory
    • Directory

    5. Under When connecting to this resource, the content should come from, click A redirection to a URL.

    6. Type the URL of the destination folder or Web site in the Redirect to box.

    For example, to redirect all requests for http://domain.com/ to http://www.domain.com, type http://www.domain.com.

    7. Click OK.

    If you do not have admin access to the IIS server, do as per your underlying technology of your Windows IIS hosted website:

    ASP Version:

    Code:

    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently" 
    Response.AddHeader "Location", "http://www.domain.com"
    %>
    Code (markup):
    ASP.NET Version:

    Code:

    <script runat="server">
    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.Status = "301 Moved Permanently";
    Response.AddHeader("Location","http://www.domain.com");
    }
    </script>
    Code (markup):
    PHP Version:

    Code:

    <?php
     header("HTTP/1.1 301 Moved Permanently");
     header("Location: http://www.domain.com");
    ?>
    Code (markup):
     
    seojunkie, May 10, 2006 IP
  6. hasitruparel

    hasitruparel Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    hi Sufyan,

    thanks for your prompt reply, i tried to go into my iis manager, and i see the following in home directory, an option "A directory located on this computer" is the option selected and i see all the folder path where my entire website is stored.

    this is a dedicated server and is loaded with only one website, please advice if i change this to the way you are proposing?
     
    hasitruparel, May 10, 2006 IP
  7. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #7
    maybe the ServerBindings in the advanced mode of the IIS Settings will do:

    Try :this:

    Hope it Helps
     
    theblight, May 10, 2006 IP
  8. hasitruparel

    hasitruparel Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    i want to configure it in such a way that all the respecitive page of domainname.com/yahoo.html should go to www.domainname.com/yahoo.com
     
    hasitruparel, May 12, 2006 IP
  9. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #9
    could you explain it further, it got me confused and why do you have a yahoo.com on your subfolder?
     
    theblight, May 12, 2006 IP
  10. hasitruparel

    hasitruparel Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    what i meant was forward it to yahoo.html
     
    hasitruparel, May 12, 2006 IP
  11. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Try this!
    
    RewriteCond %{HTTP_HOST} !^www\.somesite\.com [NC]
    RewriteRule ^(.*) http://www.somesite.com$1 [L,R=301]
    
    Code (markup):
    this would do and please remove the old 301 that exist and give it a go, but please clear your browser cache first.
     
    theblight, May 12, 2006 IP