Buying Need a quick 301 redirect for in global.asa file

Discussion in 'Programming' started by mountainGoat, Sep 29, 2009.

  1. #1
    I've never done redirects in asp, always used Apache servers.

    Need to redirect the whole site to the index page of a new site using global.asa, have onyl FTP access, no cpanel.

    Think it takes 2-3 lines of code, not able to manage. Willing to pay $5.
     
    mountainGoat, Sep 29, 2009 IP
  2. Mark Henderson

    Mark Henderson Well-Known Member

    Messages:
    402
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    ASP
    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location","http://www.new-url.com/"
    %> 
    Code (markup):
    ASP.NET
    <script runat="server">
    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.Status = "301 Moved Permanently";
    Response.AddHeader("Location","http://www.new-url.com");
    }
    </script>
    Code (markup):
    If to your requirements, you can paypal me at - Thanks!
     
    Mark Henderson, Sep 29, 2009 IP
  3. mountainGoat

    mountainGoat Active Member

    Messages:
    159
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    75
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    Thanks for replying. I tried that but it's not working, I get an error.

    Here is my global.asa file:
    <SCRIPT LANGUAGE=VBScript RUNAT=Server>

    Sub Application_OnStart

    End Sub

    Sub Application_OnEnd
    'nothing needed here for this example
    End Sub

    Sub Session_OnStart
    Application.lock
    Application("ActiveUsers") = Application("ActiveUsers") + 1
    Application.unlock
    End Sub

    Sub Session_OnEnd
    Application.lock
    Application("ActiveUsers") = Application("ActiveUsers") - 1
    Application.unlock
    End Sub

    </SCRIPT>


    Can I tried your code under "Sub Application_OnStart" both with <& &> and without, but it did not work.
     
    mountainGoat, Sep 29, 2009 IP
  4. silverstoneindia

    silverstoneindia Well-Known Member

    Messages:
    223
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    silverstoneindia, Sep 30, 2009 IP
  5. mountainGoat

    mountainGoat Active Member

    Messages:
    159
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    75
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    Thanks, but the problem with .ASP is that there is no .htaccess file, that's for Apache servers.
     
    mountainGoat, Sep 30, 2009 IP