Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

301 Redirects on Windows Shared Hosting (Blacknight)

Options
  • 20-10-2009 7:38pm
    #1
    Closed Accounts Posts: 8,866 ✭✭✭


    hi guys, i want to set up a 301 redirect from a clients old site, their new site is on a new server and using a new domain name.

    preferably i'd like to set up a number of unique redirects from specific pages on the old site to the corresponding page on the new site but at the moment even just a how to on getting a plain old 'all requests to www.old-domain.com redirect to www.new-domain.com' config would be great.

    thanks

    adam


Comments

  • Moderators, Politics Moderators Posts: 39,853 Mod ✭✭✭✭Seth Brundle


    option 1: have redirects set up with your domain registrar
    option 2: assuming they are both hosted on the same hosting a/c, set up new-domain.com as an alias to old-domain.com (with new-domain's domain nameservers etc pointing to BK's servers) - IIRC you will also need to notify BK tech support to have the domain picked up


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    thanks for that. i've gotten the initial redirect sorted with isapi, now all requests to domainA.com or domainA.com/anything redirect to domainB.com's home page.

    i've read that i'm not going to be able to set up individual page redirects on the windows shared server, is this true can anyone tell me?


  • Moderators, Politics Moderators Posts: 39,853 Mod ✭✭✭✭Seth Brundle


    You should ask BK as this isn't their support forum!
    They also have a forum on here - http://www.boards.ie/vbulletin/forumdisplay.php?f=375


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    well it's not exactly a blacknight specific thread, i just put that in brackets in case anyone was familiar with the blacknight cp and a solution within it. now it's simply a case of can i do page specific 301's on a windows server...? thanks for your help so far


  • Registered Users Posts: 16,413 ✭✭✭✭Trojan


    Adam wrote: »
    well it's not exactly a blacknight specific thread, i just put that in brackets in case anyone was familiar with the blacknight cp and a solution within it. now it's simply a case of can i do page specific 301's on a windows server...? thanks for your help so far

    One of these methods should work for you:

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

    ASP .NET
    <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>
    


  • Advertisement
  • Registered Users Posts: 16,413 ✭✭✭✭Trojan


    Trojan wrote: »
    ASP .NET
    <script runat="server">
    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.Status = "301 Moved Permanently";
    Response.AddHeader("Location","http://www.newdomain.com");
    }
    </script>
    

    I just verified the ASP.NET code above on Blacknight windows shared hosting, with this code only in the Index.aspx file.

    Note that you will probably need a standard Web.config file there also - sample below - paste it into a new file called "Web.config" and put in your old domain root alongside the above. I am not an ASP guy so I make no guarantees the following code is secure.
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.web>
        <compilation 
             defaultLanguage="c#"
             debug="true"
        />
        <customErrors 
        	mode="Off" 
        /> 
       <authentication mode="Windows" /> 
        <authorization>
            <allow users="*" /> 
        </authorization>
        <trace
            enabled="false"
            requestLimit="10"
            pageOutput="false"
            traceMode="SortByTime"
    		localOnly="true"
        />
        <sessionState 
                mode="InProc"
                stateConnectionString="tcpip=127.0.0.1:42424"
                sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
                cookieless="false" 
                timeout="20" 
        />
        <globalization 
                requestEncoding="utf-8" 
                responseEncoding="utf-8" 
       />
     </system.web>
    </configuration>
    


  • Registered Users Posts: 7,739 ✭✭✭mneylon


    ISAPI rewrite thingy (can't remember the exact name) is available on all our shared Windows servers as far as I know
    If you run into issues contact our support desk (support [@] blacknight.com) with details of what you are trying to do etc.,
    The more detail you give us, the faster we'll be able to assist you


  • Registered Users Posts: 820 ✭✭✭jetski


    Your talking about is ISAPI_Rewrite support

    Found a good guide on this here


Advertisement