I am currently trying to build 301 redirect module in sitecore9.trying to receive requested URL .will be verifying in the content tree if requested URL has redirect URL then redirect to the URL with status code 301
Class:
public class RedirectProcessor : HttpRequestProcessor
{
public override void Process(HttpRequestArgs args)
{
if (Sitecore.Context.Item == null)
{
var requestedUrl = HttpContext.Current.Request.Url.ToString();
var requestedPath = HttpContext.Current.Request.Url.AbsolutePath;
var requestedPathAndQuery = HttpContext.Current.Request.Url.PathAndQuery;
var db = Sitecore.Context.Database;
Sitecore config:
<processor type="Website.Foundation.Redirect.RedirectProcessor" patch:instead="*[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']"/>
I am getting an error page after Sitecore login. I am not sure using ItemResolver is correct or not. what is the pipeline have to used for customizing rendering pipeline