New-to-this -- How to add a redirect script in the default document in the root directory

Discussion in 'ASP.NET 2.0' started by labemho, Aug 30, 2007.

  1. Question: I am very new to this, so I think my problem is really basic. My address is www.mydomain.com. However, in order to get access to my site you have to type in <a target="_blank" href="http://www.mydomain.com/CS/Web">www.mydomain.com/CS/Web</A>(community server). This will be real pain for others if they have to type in the file extensions everytime they want to visit my site. How do I resolve this issue so that when I type in
    www.mydomain.com it will go directly to my site?

    > Thanks for your help and sorry for such an 101 question.

    Answer from DASP

    I do apologize as I'll only be able to provide a limited amount of assistance with your ticket as it is outside the scope of technical support but I can provide you with some general information and direct you to a great resource.

    What you can do is add a redirect script in the default document in the root directory to go to /cs/web. I'm sorry I don't have a sample to
    furnish you with but if you should require further assistance, you can post your question in the DiscountASP.NET Community Forum http://community.discountasp.net/> for peer support. It's a very active community and many of the DiscountASP.NET staff members post
    resolutions to the problems posted.


    Any direction to fix this will be very much appreciated. Thanks
     
  2. Since you are using a sub-application(sub-folders) on your site,you will have to create a redirect script in the root,which takes the visitors to the required sub-application.
    Just have a Response.Redirect("/CS/Web/yourdefaultpage.aspx") in your default page(default.aspx for instance)within your root.

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Thanks for your reply. I really appreciate it.

    However, as Im very new-to-this, would it be possible to lay out the steps for me to redirect in laymans terms. You make it sound very easy, but Im sitting here staring at the computer, not knowing where Response.redirect is, or my default page in my root.

    Thanks so much for your time and patience.
     
  4. I am still eagerly waiting for some direction.


    Can someone please tell me how to place a default document on my document root.


    I did see this http://kb.discountasp.net/article.aspx?id=10102"Redirect a subdomain to a subdirectory"





    However, I need more detailed, specific instructions. Thanks in advance.
     
  5. Create a default asp.net page in your site's root (lets say default.aspx[set default.aspx as your default page from the default documents section in the Control Panel>IIS Manager]) and add the code specified at http://kb.discountasp.net/article.aspx?id=10102 within that page .

    So,in your case ,the re-direct code will be as follows:

    <%
    If InStr( UCase(Request.ServerVariables('SERVER_NAME')), UCase('mydomain.com') ) > 0 Then
    Response.Redirect('/CS/Web/yourdefaultpage.aspx')
    %>

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     

Share This Page