November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
You can use the IIS rewrite module with the following rule:
<rewrite>
<rules>
<rule name="CountryRewriter" stopProcessing="true">
<match url="^([^/]+)/customers/([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/{R:1}/customers/?country={R:2}" />
</rule>
</rewrite>
You can read more about using this in EPiServer on my blog:
Thanks David, very interesting! Unfortunately we are still stuck in the IIS 6 mud...any options?
In that case I would try http://urlrewriter.net/. You can achieve the same result using it. This page describes how this is possible:
http://urlrewriter.net/index.php/support/reference/actions/rewrite
David
Much appreciated! I have not decided which way to go yet, thus I will mark both suggestions as answers. Thank you!
Hi,
The topic might be misleading, but could not come up with anything better. Here is a concrete scenario:
Let's say I have a page called Customers (www.xyz.com/customers). On this page, the user can select a country (dropdownlist) to show only customers located in this specific country. Today this this is solved by using the same page with a query parameter, e.g. www.xyz.com/customers?country=SE, which only shows customers in Sweden.
Now what we would like to achieve is that when the user selects a country (on the www.xyz.com/customers landing page), he is redirected a new URL instead of using query parameters, e.g. to www.xyz.com/customers/se. We would like to achieve this for a couple of reasons, for instance to be able to track how many users that specifically looked at the swedish customers (e.g. by monitoring that specific URL in Google Analytics). Another perspective is SEO.
The list of selectable countries is created dynamically based on the what exists in a database (i.e. I cannot predefine pages in the page structure to redirect to).
How can I achieve this? Is there some kind of URL rewrite mechanism that I can utilize for this only?