Requirement- There should be a link in a custom access denied page to sign in as a different user in a SP 2013 web application.
This is achieved by creating a custom application page and deployed as a farm solution. Sign in as different user is a hyperlink in the page and linked to URL
_layouts/closeConnection.aspx?loginasanotheruser=true. This link works fine when it is deployed as application page in the 15 hive.
However, once I make this the access denied page for my web application, the link redirects back to the access denied page itself.
How do I fix this issue?