Copied to clipboard

Flag this post as spam?

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


  • Jelle 6 posts 46 karma points
    Jul 17, 2015 @ 08:04
    Jelle
    0

    Restrict access by IP-address

    Hi,

    I have one Umbraco instance for multiple sites. One of those sites is in production right now, but the other sites are still for preview purposes only and need te be closed for external users.

    Before I had an IP-restriction in my web.config, with the

    But what I want is to restrict access by IP-address for these sites. So the people who are creating content can do their normal job and publish content, but it's only viewable for our IP-address.

    I've tried the Intranet Restrict package, but this isn't working for my Umbraco 7.2.6 install.

    I hope someone can help me out to realize this?

    So: www.site1.com is public www.site2.com is restricted for IP-address 1.2.3.4

    Both domains are running the same Umbraco instance.

    Thanks!

  • Mike Chambers 636 posts 1253 karma points c-trib
    Jul 19, 2015 @ 08:36
    Mike Chambers
    100

    with urlrewrite for iis.. (which I think is what you might already have been using previously for a global ip-restriction) you can utilise conditions on the rules... both on the host domain and the ip.

    https://docs.secureauth.com/display/KBA/URL+Rewrite+-+IP+Restrictions

    with the addition of a similar condition for the domain.

    <add input="{HTTP_HOST}" pattern="^www\.test\.com$" />
    

    So a few rules with host and ip conditions should cover your requirements?

  • Jelle 6 posts 46 karma points
    Jul 20, 2015 @ 09:00
    Jelle
    0

    Thanks! I've added this to my web.config:

    <system.webServer>
      <rewrite>
        <rules>
          <rule name="Block test.domain.com and keep open for 1.2.3.4" stopProcessing="false">
            <match url="(.*)" />
            <conditions>
              <add input="{HTTP_HOST}" pattern="test.domain.com" />
              <add input="{REMOTE_ADDR}" pattern="^(1\.2\.3\.4)$" negate="true" />
            </conditions>
            <action type="CustomResponse" statusCode="403" statusDescription="Forbidden" />
          </rule>
          ...
    
Please Sign in or register to post replies

Write your reply to:

Draft