1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

asp redirect question

Discussion in 'C#' started by schoash, Mar 12, 2008.

  1. #1
    I wanna redirect all the traffic which comes to a website to the website with the new domain. How can I do this in asp?
    On apache it would be an easy entry in the .htaccess but asp?

    tia for your help
     
    schoash, Mar 12, 2008 IP
  2. jawahar

    jawahar Active Member

    Messages:
    1,044
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #2
    <%
    response.redirect("yournewdomain.com")
    %>

    ASP Tutorial
     
    jawahar, Mar 12, 2008 IP
  3. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You do it with the global.asa or global.asax depending on if it is classic or .net file but this only fires if the request is for a page that will go through the asp/ .net framework. It is one of the few negatives of IIS -v- Apache unfortunately.

    You are also probably better doing a 301 or 302 redirection but that is up to you on what your trying to achieve
     
    AstarothSolutions, Mar 12, 2008 IP
  4. Free Born John

    Free Born John Guest

    Messages:
    111
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    what about adding the old site url as a host header on the new site and deleting the iis entry for the old one.

    Google might not like it though.
     
    Free Born John, Mar 13, 2008 IP
  5. justkidding

    justkidding Active Member

    Messages:
    937
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #5
    make a 301 redirect as you have a new domain.
     
    justkidding, Mar 13, 2008 IP
  6. paul_delaney

    paul_delaney Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    use an asp 301 permanent redirect just google "asp 301 redirect" for the code
     
    paul_delaney, Mar 18, 2008 IP
  7. scorpion14

    scorpion14 Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Create a site map for new one and mention it in robot.txt file
     
    scorpion14, Mar 18, 2008 IP
  8. IndiaNets

    IndiaNets Guest

    Best Answers:
    0
    #8
    If you are using asp.net...

    <script runat="server">
    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.Status = "301 Moved Permanently";
    Response.AddHeader("Location","http://your-new-domain.com/");
    }
    </script>
    Code (markup):
     
    IndiaNets, Mar 20, 2008 IP