Sitecore Redirect module Regex Pattern Matching -
using 301 redirect module sitecore 7, i'm having problem establishing proper requested expression , source values use in sitecore redirect module. have example url typically getting request want redirected home page of site.
the example url requests contain excite.com @ end of url:
https://www.example.com/products/foods/apples/excite.com https://www.example.com/products/foods/oranges/excite.com https://www.example.com/products/foods/pears/excite.com
i these requests contain excite.com @ end redirected home page (https://www.example.com) can't life of me figure out.
i haven't used 301 redirect module have used similar modules. there 2 issues need resolving.
you need create redirect using pattern match redirect. regex need "match request ends /excite.com
"
.*(/excite.com)$
the other issue sitecore seeing .com
part of url extension , filtering request. need add com
list of allowed extensions.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <preprocessrequest> <processor type="sitecore.pipelines.preprocessrequest.filterurlextensions, sitecore.kernel"> <param desc="allowed extensions (comma separated)">aspx, ashx, asmx, com</param> </processor> </preprocessrequest> </pipelines> </sitecore> </configuration>
all said, if using iis rewrite module add rule in there resolved , redirect before hit sitecore pipelines , therefore not need worry allowed extensions filter.
<rules> <rule name="redirect excite.com" stopprocessing="true"> <match url=".*(/excite.com)$" /> <action type="redirect" url="https://{http_host}" appendquerystring="false" /> </rule> </rules>
change regex (excite.com)$|.*(/excite.com)$
if want match http://ww.example.com/excite.com
Comments
Post a Comment