Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • eaus 9 posts 39 karma points
    Oct 20, 2013 @ 09:20
    eaus
    0

    Multiple sites on one instance - hide intranet from web?

    We have an installation of Umbraco 4.0.3 which run both our internet website as well as our intranet website. For security reasons I dont want the intranet website avalaible on the internet - what are my options here?

    Perhaps I could add some ASP-code to my masterpage on the intranet to validate for a local IP-address, and if yes; how? Unfortunately I had some bad luck trying to succeed with this..

  • eaus 9 posts 39 karma points
    Oct 20, 2013 @ 22:27
    eaus
    0

    I believe I have solved it by adding this to the top of my MasterPage for the intranet site:

    <script type="c#" runat="server">
    public string Ip()
    {
        string ipAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (ipAddress == null || ipAddress == "")
        {
            ipAddress = Request.ServerVariables["REMOTE_ADDR"];
        }
        return ipAddress.Split('.')[0];
    }
    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Ip() != "10")
        {
            Response.Redirect("http://www.internet-site.com/");    
        }
    }
    </script>

    Any thoughts on this is highly appreciated..

  • Mark Bennett 199 posts 375 karma points
    Oct 23, 2013 @ 11:59
    Mark Bennett
    0

    Eaus,

    So is the intranet and internet content in a different content tree?

    Personally that's how I would have set it up - you can then mount the sites using IIS and host headers to have two completely seperate websites under the same Umbraco instance. Security / Access etc can then all be managed via IIS.

    Cheers, Mark.

Please Sign in or register to post replies

Write your reply to:

Draft