I'm about to build a rather large website from scratch on Umbraco (of course, duh'!) and I have just received a document from the client with nothing less than over 1600 URLs from the old site that needs to be 301 redirected on the new site.
Also, the client wants to be able to create these redirects themselves from Umbraco.
I've looking into the ever awesome package, 301 Redirect Tracker which suits the needs perfectly. There's just one major caveat to this: nearly all of the old urls are .html and .php which the package doesn't seem to be able to handle :-(
Has anyone found a way to make it handle these extensions aswell as .aspx?
I'd also like to hear your experience with this subject since I can only image that this won't be the last time I'm running into this situation.
Yes, regex isn't my strong point either. In this case it looks like I've missed out the dot from the 2 nd expression; should be "(.*)"
To make it go deeper is possible e.g. you could make a rule for /page1/page2/page3/page4.html to go to /products/page4. I suggest you google some online regex tools so you can test and develop the regex if you're going to do this as it will be reasonably hard to test toherwise.
For working with RegEx, I highly recommend Expresso, it's free, and has a RegEx builder tool, and workbench to allow you to test out your RegExs. I've been using it for years, it's great.
Major 301 redirects/url rewriting
Hi all,
I'm about to build a rather large website from scratch on Umbraco (of course, duh'!) and I have just received a document from the client with nothing less than over 1600 URLs from the old site that needs to be 301 redirected on the new site.
Also, the client wants to be able to create these redirects themselves from Umbraco.
I've looking into the ever awesome package, 301 Redirect Tracker which suits the needs perfectly. There's just one major caveat to this: nearly all of the old urls are .html and .php which the package doesn't seem to be able to handle :-(
Has anyone found a way to make it handle these extensions aswell as .aspx?
I'd also like to hear your experience with this subject since I can only image that this won't be the last time I'm running into this situation.
Any help/hint is greatly appreciated!
Thanks in advance.
Bo
depending on your setup it might be possible to make a couple regex that wil cover most of the cases e.g.
<add name="redirHTML"
virtualUrl="(.*)://www.site.com/(*).html"
rewriteUrlParameter="IncludeQueryStringForRewrite"
destinationUrl="$1://www.site.com/$2"
ignoreCase="true"
redirect="Domain"
redirectMode="Permanent" />
Hi Paul,
Thanks a lot for your input :-)
I've tried your regex, but I'm getting the following error:
parsing "(.*)://umbtestsite.local/(*).html" - Quantifier {x,y} following nothing.
I've tried with the following url rewrite:
<add name="redirHTMLLvl1"
virtualUrl="(.*)://umbtestsite.local/(*).html"
rewriteUrlParameter="IncludeQueryStringForRewrite"
destinationUrl="$1://umbtestsite.local/$2"
ignoreCase="true"
redirect="Domain"
redirectMode="Permanent" />
Admittedly I'm not the strongest when it comes to regex ;-)
Also, is it possible to make it go deeper? Som urls are like this: /page1/page2/page3/page4.html and som even deeper than that.
Thanks again!
- Bo
Yes, regex isn't my strong point either. In this case it looks like I've missed out the dot from the 2 nd expression; should be "(.*)"
To make it go deeper is possible e.g. you could make a rule for /page1/page2/page3/page4.html to go to /products/page4. I suggest you google some online regex tools so you can test and develop the regex if you're going to do this as it will be reasonably hard to test toherwise.
For working with RegEx, I highly recommend Expresso, it's free, and has a RegEx builder tool, and workbench to allow you to test out your RegExs. I've been using it for years, it's great.
:)
is working on a reply...