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.
Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up.
Sign up to join this communityWe 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.
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.
Go to IIS. Select Admin folder under the Sitecore folder. In Feature View, Double click on Authentication.
Select Anonymous Authentication and click Disable.
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