Friday, 13 September 2013

Redirect SharePoint 401 Unauthorized back to login page



Login Redirect.

 When you hit cancel on SharePoint login promp it takes you to an annoying "401:Unauthorized"





in case you do not want this message, Instead want SharePoint to redirect back to the login page follow the below steps

Create a default redirect file
1) Add the attached htm file… Default.htm and place it in “C:\inetpub\custerr\en-US\Custom”

Modify applicationHost.config to enable custom error on target Web-Application
1) Open file “C:\Windows\System32\inetsrv\config\applicationHost.config” in notepad.
2) Find the tag (replace with valid webapplication Name as in IIS manager)
<location path="xxxxxxxxxxxxxxxxxx">
3) Replace
<httperrors existingresponse="PassThrough"> 
With
 <httpErrors allowAbsolutePathsWhenDelegated="true" errorMode="Custom" existingResponse="PassThrough" />
4) Save and Exit
IIS entry for the redirect page in target Web-Application
1) Open IIS Manager (Start > run > inetmgr)
2) Select the Web Application > Error Pages
3) Add a custom error page for 401.1 and point it to the custom Default.htm
4) Similarly, repeat step 3 to make an entry for 401.2
5) Also, Edit the default 401 item to set the same path and Exit IIS Mgr
6) Edit the web.Config of the webApp and Find
 <httperrors>
 Replace with
<httperrors errormode="Custom" existingresponse="Auto">
7) Save and close.

Tags: SharePoint custom Redirect | IIS
Saravjeet Lamba

No comments:

Post a Comment