C# Class SharedSource.RedirectModule.Processors.RedirectProcessor

Redirection Module which handles redirects. Both exact matches and regular expression pattern matches are supported.
Inheritance: HttpRequestProcessor
显示文件 Open project: thecadams/301RedirectModule

Public Methods

Method Description
Process ( HttpRequestArgs args ) : void

The main method for the processor. It simply overrides the Process method.

Private Methods

Method Description
AllowRedirectsOnFoundItem ( Database db ) : bool
CheckForDirectMatch ( Database db, string requestedUrl, string requestedPath, HttpRequestArgs args ) : void
CheckForRegExMatch ( Database db, string requestedUrl, string requestedPathAndQuery, HttpRequestArgs args ) : void
CheckForRulesMatch ( Database db, string requestedUrl, string requestedPathAndQuery, HttpRequestArgs args ) : void
GetRedirectToItemUrl ( System.Item redirectToItem ) : string
GetRedirects ( Database db, string templateName, string versionedTemplateName, string queryType ) : IEnumerable

This method return all of the possible matches for either the exact matches or the pattern matches Note: Because Fast Query does not guarantee to return items in the current language context (e.g. while in US/English, results may include other language items as well, even if the US/EN language has no active versions), an additional LINQ query has to be run to filter for language. Choose your query type appropriately.

GetResponseStatus ( System.Item redirectItem ) : ResponseStatus
SendResponse ( System.Item redirectToItem, string queryString, ResponseStatus responseStatus, HttpRequestArgs args ) : void

Once a match is found and we have a Sitecore Item, we can send the response.

SendResponse ( string redirectToUrl, string queryString, ResponseStatus responseStatusCode, HttpRequestArgs args ) : void

Method Details

Process() public method

The main method for the processor. It simply overrides the Process method.
public Process ( HttpRequestArgs args ) : void
args HttpRequestArgs
return void