Yes Jason,
The URL Rewriter will be supported in Sitefinity 3.0. You will be able to use the same rule base URL rewriting as in version 2.7. It will be included in the upcoming Sitefinity 3.0 release candidate. As in previous versions, the URL Rewriter is switched OFF by default. To switch it ON, you need to do the following changes in the Web.config file:
- Add a configuration section element (<configSections>):
<configuration> … <configSections> <sectionGroup name="telerik"> ... <section name="urlrewrites" type="Telerik.Cms.Web.AdvancedUrlRewriter, Telerik.Cms"/> </sectionGroup> </configSections> |
- Replace the default CmsHttpModule with CmsHttpModuleUrlRewrite (shipped with Sitefinity).
Change these lines:
<httpModules> <add name="Cms" type="Telerik.Cms.Web.CmsHttpModule, Telerik.Cms"/> </httpModules> |
With:
<httpModules> <add name="Cms" type="Telerik.Cms.Web.CmsHttpModuleUrlRewrite, Telerik.Cms"/> </httpModules> |
- Add an <urlrewrites> section:
<configuration> <telerik> … <urlrewrites> <!-- Add your rule elements here --> <rule> <url>[input URL pattern]</url> <rewrite>[replaced URL]</rewrite> </rule> </urlrewrites> |
This section sets the rules for rewriting the URLs. You can add one or more rules here. Rewriting is based on the regular expressions technology (more details you can find here). It is similar to using the RegEx.Replace() method in .NET and <url> is a pattern expression and <rewrite> is a replacement string.
Example:
If you have a products page (products.aspx) that will manage each product, requesting a Product Id (ProdId) in the query string, and you want to access each product without using a query string, you may have the following rule in <urlrewrites>:
<urlrewrites> <rule> <url>product(.*)\.aspx</url> <rewrite>Products.aspx?ProdId=$1</rewrite> </rule> </urlrewrites> |
This will rewrite the URLs in the following manner:
|
URL |
Will be rewrited to: |
| product1.aspx |
products.aspx?ProdId=1 |
| product2.aspx |
products.aspx?ProdId=2 |
| productAny.aspx |
products.aspx?ProdId=Any |
Also, except the above advanced method Sitefinity 3.0 will provide 2 other ways to Rewrite URLs, which do not require changes in the Web.config:
-
You can specify more than one URL for a page from Page Properties (Friendly URLs)
-
Setting the regular expression rule for a page URL directly from the Page Properties UI (will not be included in the RC)
Greetings,
Vlad
the telerik team