Do you want to put your rule in umbracoSettings.config?
Have you considered the IIS rewrite module? I find it personally easier to work with and performs better. I can probably provide some examples of the latter and a rewrite rule for the above mentioned redirect rule if you want to go with the IIS rewrite module which probably requires at least IIS 7.
Sorry, I meant UrlRewriting.config in the config folder in the root site, not umbracoSettings.config.
I don't think it will be a problem on a shared hosting environment because the rewrite rules will be relative to your IIS site. I can do a POC on that if you like. I've only tried on a dedicated server and I went with that solution because I read somewhere that the URL rewriting engine in umbraco does not perform so good.
However the IIS rewrite module extension has to be installed in order for it to work. You can either write the rules directly in your web.config or in the IIS interface. The request is handled directly by the IIS.
Here are some real life examples from a specific client
UrlRewriting rule, ?p=123 to folder like struture
Hi,
I am struggling with a URLrewrite and cant seem to get into work.
I have this type of url:
/order/choose-tyres?plate=UU25716
The 'choose-tyres' can vary.
I am trying to get this result:
/choose-tyres/UU25716
My latest attempt. Can anyone help?
Do you want to put your rule in umbracoSettings.config?
Have you considered the IIS rewrite module? I find it personally easier to work with and performs better. I can probably provide some examples of the latter and a rewrite rule for the above mentioned redirect rule if you want to go with the IIS rewrite module which probably requires at least IIS 7.
Kind regards,
Bilal
Hi,
in umbracoSettings.config: Is that an option?
Dont really care where the rule is, as longs as it works.
IIS rewrite module
Might be difficult on shared hosting, or?
Actually i can acces my site thru IIS, even on shared hosting.
Did you have some examples?
Sorry, I meant UrlRewriting.config in the config folder in the root site, not umbracoSettings.config.
I don't think it will be a problem on a shared hosting environment because the rewrite rules will be relative to your IIS site. I can do a POC on that if you like. I've only tried on a dedicated server and I went with that solution because I read somewhere that the URL rewriting engine in umbraco does not perform so good.
However the IIS rewrite module extension has to be installed in order for it to work. You can either write the rules directly in your web.config or in the IIS interface. The request is handled directly by the IIS.
Here are some real life examples from a specific client
</httpProtocol>
<rewrite>
<rules>
<clear />
<rule name="Static Redirect 35" stopProcessing="true">
<match url="dk/showpage\.aspx$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{QUERY_STRING}" pattern="pageid=785" />
<add input="{QUERY_STRING}" pattern="m901ID=1013" />
</conditions>
<action type="Redirect" url="afdelinger/emerging-markets-aktier" appendQueryString="false" redirectType="Permanent" />
</rule>
<rule name="Static Redirect 2" stopProcessing="true">
<match url="dk/showpage\.aspx$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{QUERY_STRING}" pattern="pageid=374" />
</conditions>
<action type="Redirect" url="afdelinger/afdelingsoversigt" appendQueryString="false" redirectType="Permanent" />
</rule>
<rule name="Static Redirect 5" stopProcessing="true">
<match url="dk/showpage\.aspx$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{QUERY_STRING}" pattern="pageid=1905" />
</conditions>
<action type="Redirect" url="/" appendQueryString="false" redirectType="Permanent" />
</rule>
<rule name="Rewrite Rule">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{Static Redirects:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Rewrite" url="{C:1}" />
</rule>
</rules>
<rewriteMaps>
<rewriteMap name="Static Redirects">
<add key="/dk/afdelinger" value="/afdelinger/afdelingsoversigt" />
</rewriteMap>
</rewriteMaps>
</rewrite>
</system.webServer>
The idea is to place the specific rules at the top so they get hit first so the order of the redirects matters.
is working on a reply...