1

We have a requirement to have the CM and CD in the same server.

But while we are trying to access the CD URL as www.xyz.com/sitecore we are landing to the sitecore admin page.

Is there a way to deny access to the admin page with CD url.

2

I assume that with "same server" you are talking about the same instance (otherwise you just need to apply the hardering setup).

In this case, a possible solution could be to use the IIS rewrite module to set redirects on the folders you want to deny on the CD url. Put a redirect on /sitecore/admin, /sitecore/debug, /sitecore/login, /sitecore/shell/WebService and all their children to any path you want (e.g. your homepage)

Edit: as Jose mentioned: this approach does require 2 domain names to make a distinction between CM and CD. Best practice would be to make the CM not publicly available.

ps: don't do this for the entire /sitecore folder.. that would break your CD.

  • 1
    Needs to assign 2 domains to the site so can be accessed from CM – josedbaez Jun 27 '18 at 14:45
  • 1
    Sitecore will still run all the CM pipelines on the CD URL. So if you put ?sc_mode=edit on the URL for example then you'll have issues. To fix that, you'll need to have another site on the config with enableWebEdit=false etc – Mark Gibbons Jun 27 '18 at 23:17
1

Go to IIS. Select Admin folder under the Sitecore folder. In Feature View, Double click on Authentication.

enter image description here

Select Anonymous Authentication and click Disable.

enter image description here

0

You can also deny access to the sitecore folder in the web.config, but keep in mind that some directories should be accessable:

<!-- Deny users access to internal paths -->
<location path="sitecore" xdt:Transform="Insert">
    <system.web>
        <authorization>
            <deny users="*"/>
        </authorization>
    </system.web>
</location>
<location path="sitecore modules" xdt:Transform="Insert">
    <system.web>
        <authorization>
            <deny users="*"/>
        </authorization>
    </system.web>
</location>
<location path="sitecore/service" xdt:Transform="Insert">
    <system.web>
        <authorization>
            <allow users="*"/>
            <!--heartbeat, keepalive, ect. must be accessible-->
        </authorization>
    </system.web>
</location>
<location path="sitecore/shell/Webservice/Service.asmx" xdt:Transform="Insert">
    <system.web>
        <authorization>
            <allow users="*"/>
            <!--allow webservice-->
        </authorization>
    </system.web>
</location>
<location path="sitecore modules/Web/Web Forms for Marketers/mvc" xdt:Transform="Insert">
    <system.web>
        <authorization>
            <allow users="*"/>
            <!--allow WFFM Assets -->
        </authorization>
    </system.web>
</location>

As you can see we use XML-Transformation to do that on CD-Server config only.

Best regards Dirk

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.