Circumvent member login page when using special useragent string
Is it possible to show a page that is password protected in Umbraco instead of redirecting the visitor to the login page when the useragent HTTP header has a custom string set?
I'm using an external search engine (Swiftype) that crawls my website but obviously password protected pages are not getting indexed. However, in the settings of the crawler I can set a custom useragent string. The problem is that I don't know how I should cancel the redirect to the login page. Any ideas?
Circumvent member login page when using special useragent string
Is it possible to show a page that is password protected in Umbraco instead of redirecting the visitor to the login page when the useragent HTTP header has a custom string set?
I'm using an external search engine (Swiftype) that crawls my website but obviously password protected pages are not getting indexed. However, in the settings of the crawler I can set a custom useragent string. The problem is that I don't know how I should cancel the redirect to the login page. Any ideas?
I was able to solve it myself. Improvements/suggestions always welcome.
If you are going to use this code, don't forget to change the
DocumentTypeAlias
properties, thesecret-crawler-useragent-id
andTrySetTemplate(...)
is working on a reply...