I have a site I'm redesigning into Sitecore. The old URLs are at https://[host]/Old/[path(s)]/Pages/[ID].aspx
and I want them to be translated to https://[host]/Post/[ID]
. I wrote an IIS redirect rule for this that, when I test the URL sample, works to get the [ID]
out.
When I put the old URL in, though, I get a Sitecore not found message pointing to the old URL, but it drops the .aspx portion and also, if there's a hyphen in the [ID]
it disappears in favor of a space. I did add "/old" URL to the "IgnoreUrlPrefixes" setting in Sitecore, so I thought that would basically keep Sitecore out of it.
My rule definitions:
- Requested URL matches the pattern, using regular expressions
- Pattern:
^/(.*)/Pages/(.*).aspx
(the pattern tester in IIS reported success) - Action type: Redirect (301), to
/Post/{R:2}
Any thoughts? Thanks.
/
? Can you try^(.*)/Pages/(.*).aspx
instead, or I guess it should be^Old/(.*)/Pages/(.*).aspx
? – Søren Kruse Nov 3 '16 at 8:25/
. If you would move it into a rewrite map though, you do. So, as Søren mentioned, remove the/^
in the beginning. I'll let Søren put it as answer when verified, as he mentioned it first ;) – Gatogordo Nov 3 '16 at 8:32