Next, I want to write a set of regex expressions that change underscore (_) to hyphen (-) anywhere it appears in the URL path EXCEPT for the /media folder. I can't get my head around this or how to do it to an unlimited dept in the url path (or say at least 10 folders maximum depth). I want to change underscores to hyphens whether they are in the directory structure or the aspx file name.
URLRewriting.net and changing underscore to hyphen
I'm not a RegEX expert by any means (need to put that on my bucket list).
The first thing I was able to accomplish was to trim all of my aspx files so that I could useDirectoryURLs all the time.
<add name="SEOTrimASPX"
virtualUrl="^/(?![0-9]+.aspx)(?!umbraco/)([^\?]*?).aspx$"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="/$1/"
redirect="Application"
redirectMode="Permanent"
ignoreCase="true" />
Next, I want to write a set of regex expressions that change underscore (_) to hyphen (-) anywhere it appears in the URL path EXCEPT for the /media folder. I can't get my head around this or how to do it to an unlimited dept in the url path (or say at least 10 folders maximum depth). I want to change underscores to hyphens whether they are in the directory structure or the aspx file name.
Ex:
www.domain.com/somedir_fun/otherdir/joe_fred/press_release.aspx
converts to
www.domain.com/somedir-fun/otherdir/joe-fred/press-release.aspx
(note: the converted URL would then likely get converted to a SEO friendly directory url from the rule above.)
If you want to change the way umbraco will write your url you will need to set this in your umbracoSetttings.config file under the config folder.
is working on a reply...