Loading...

All project content is available for reading, but you need to be a member of the project for Subversion checkout of source code, or to create/modify any information.
Login if you are a member. Apply here to request membership (open to all).

Agent Based Suffix Matching Url Rewrite Rule

Type: MakingWaves.Common.EPiServer.UrlRewriting.!AgentBasedSuffixMatchingUrlRewriteRule (assembly MakingWaves.Common.EPiServer.UrlRewriting.dll)

Works like suffix rule but additionally template selection can be performed based on User Agent sent by browser

Examples

  • /News/Website-Launch/Mobile <--> /Mobile/IPhone/Templates/News.aspx (if User Agent matches “*.IPhone.*” )
  • /News/Website-Launch/Mobile <--> /Mobile/Regular/Templates/News.aspx (for other agents)
  • /News/Website-Launch/Lite <--> /Lite/IE/Templates/News.aspx (for IE browsers)
  • /News/Website-Launch/Lite <--> /Lite/Regular/Templates/News.aspx (for other browsers)

Configuration

<makingWaves.urlRewrite>
  <rules>
    <add name="MobileRule" 
          type="MakingWaves.Common.EPiServer.UrlRewriting.AgentBasedSuffixMatchingUrlRewriteRule, MakingWaves.Common.EPiServer.UrlRewriting"
          rootPath="MobilePath/Regular" 
          urlSuffix="Mobile">
      <ruleProperties>
        <add propertyType="agent" agentPattern=".*Android.*" pathSuffix="MobilePath/Android"/>
        <add propertyType="agent" agentPattern=".*IPhone.*" pathSuffix="MobilePath/IPhone"/>
      </ruleProperties>
    </add>
  </rules>
</makingWaves.urlRewrite>