Last active
April 15, 2017 01:19
-
-
Save robearlam/a48a3b903657648df728b1162fb1d016 to your computer and use it in GitHub Desktop.
Sitecore Multisite 404, 500 & Robots.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpContext.Current.Response.StatusCode = 404; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<add type="Contains" match="~/media/" /> | |
<add type="Contains" match="~/icon/" /> | |
<add type="Contains" match="~/link.aspx" /> | |
<add type="StartsWith" match="/sitecore" /> | |
<add type="Contains" match=".asmx" /> | |
<add type="Contains" match=".ashx" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Application_Error(object sender, EventArgs args) | |
{ | |
Sitecore.MultisiteHttpModule.Errors.ErrorHandler.HandleError(Server.GetLastError()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PM> Install-Package Sitecore.MultisiteHttpModule |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<httpRequestBegin> | |
<processor type="Sitecore.MultisiteHttpModule.NotFound.NotFoundHandler, Sitecore.MultisiteHttpModule" patch:after="processor[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']" /> | |
</httpRequestBegin> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<site name="MySite" | |
... | |
notFoundPageId="{BFA65433-4552-4507-9375-C96137287640}" | |
errorPagePath="/errors/MySite.html" | |
robotsTxtLocation="/robots/MySite.robots.txt" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configSections> | |
<section name="multisiteHttpModule" type="Sitecore.MultisiteHttpModule.Configuration.MultisiteHttpModuleSettings, Sitecore.MultisiteHttpModule" /> | |
</configSections> | |
<multisiteHttpModule defaultErrorPage="/error.html" errorsEnabled="True" notFoundEnabled="True"> | |
<exclude404Rules> | |
<add type="Contains" match="~/media/" /> | |
<add type="Contains" match="~/icon/" /> | |
<add type="Contains" match="~/link.aspx" /> | |
<add type="StartsWith" match="/sitecore" /> | |
<add type="Contains" match=".asmx" /> | |
<add type="Contains" match=".ashx" /> | |
</exclude404Rules> | |
</multisiteHttpModule> | |
<system.webServer> | |
<handlers> | |
<add name="RobotsHandler" path="/robots.txt" verb="GET" type="Sitecore.MultisiteHttpModule.Robots.RobotsHandler, Sitecore.MultisiteHttpModule" /> | |
</handlers> | |
</system.webServer> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment