Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi.
Iwe just upgraded a solution from 4.0 to 4.7, the old solution had a rewrite like this:
<add name="ShopRewrite" virtualUrl="^~/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/?alias=$1" ignoreCase="true" />
The rewrite worked perfectly on the old version, because of the aspx extensions to normal pages, but iwe set
<add key="umbracoUseDirectoryUrls" value="true" />
And now the rewrite hits every page :/
I need the rewrite to take only url without the last "/"
Ex, i have a page called "frontpage", the url is:
http://localhost/frontpage/ <- this one should not hit the rewrite
Further i have 600 shops with an url alias as a property, the url generated is ex:
http://localhost/spar-aarhus <-- this one should his the rewrite, because of the missing last "/"Please tell if u need any more information.
Thx in advance.Jacob.
http://regexr.com?2ufsk
thx !!!
hey, it seems like it removes the last char:
<add name="ShopRewrite" virtualUrl="^~/(.+)(?:[^/])$" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/?alttemplate=butik&alias=$1" ignoreCase="true" />
ex:
http://localhost/store2 = http://localhost/?alttemplate=butik&storeif i type
http://localhost/store2x = http://localhost/?alttemplate=butik&store2Do u have a fix ?Best regards
Jacob
Hmm yes I see, sorry about that.
Let me take a look and I'll get right back at ya!
np, glad for ur help :) !!
Sorry, I can't seem to find a 'nice' fix. There's a quickfix though:
destinationUrl="/?alttemplate=butik&alias=$1$2"
Oh wait, I made a mistake, this is the quickfix:
<add name="ShopRewrite" virtualUrl="^~/(.+)([^/])$" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="/?alttemplate=butik&alias=$1$2" ignoreCase="true" />
pefect, it works perfectly !..
thx
Changed to:
<add name="ShopRewrite" virtualUrl="^~/(/.+)([^/.])$" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="/?alttemplate=butik&alias=$1$2" ignoreCase="true" />
the other one hit /webresource.axd :)
/J
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
urlrewrite, regex help
Hi.
Iwe just upgraded a solution from 4.0 to 4.7, the old solution had a rewrite like this:
<add name="ShopRewrite"
virtualUrl="^~/(.*)"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/?alias=$1"
ignoreCase="true" />
The rewrite worked perfectly on the old version, because of the aspx extensions to normal pages, but iwe set
<add key="umbracoUseDirectoryUrls" value="true" />
And now the rewrite hits every page :/
I need the rewrite to take only url without the last "/"
Ex, i have a page called "frontpage", the url is:
http://localhost/frontpage/ <- this one should not hit the rewrite
Further i have 600 shops with an url alias as a property, the url generated is ex:
http://localhost/spar-aarhus <-- this one should his the rewrite, because of the missing last "/"
Please tell if u need any more information.
Thx in advance.
Jacob.
http://regexr.com?2ufsk
thx !!!
hey, it seems like it removes the last char:
<add name="ShopRewrite"
virtualUrl="^~/(.+)(?:[^/])$"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/?alttemplate=butik&alias=$1"
ignoreCase="true" />
ex:
http://localhost/store2 = http://localhost/?alttemplate=butik&store
if i type
http://localhost/store2x = http://localhost/?alttemplate=butik&store2
Do u have a fix ?
Best regards
Jacob
Hmm yes I see, sorry about that.
Let me take a look and I'll get right back at ya!
np, glad for ur help :) !!
Sorry, I can't seem to find a 'nice' fix. There's a quickfix though:
destinationUrl="/?alttemplate=butik&alias=$1$2"
Oh wait, I made a mistake, this is the quickfix:
<add name="ShopRewrite"
virtualUrl="^~/(.+)([^/])$"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="/?alttemplate=butik&alias=$1$2"
ignoreCase="true" />
pefect, it works perfectly !..
thx
Changed to:
<add name="ShopRewrite"
virtualUrl="^~/(/.+)([^/.])$"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="/?alttemplate=butik&alias=$1$2"
ignoreCase="true" />
the other one hit /webresource.axd :)
/J
is working on a reply...