I'm redirect some static html files/urls to some new urls like this:
Redirect 301 / http://newsite.com
Redirect 301 /pageA.html http://newsite.com/subfolder/page-a/
Redirect 301 /pageA-B.html http://newsite.com/subfolder/page-a/page-b/
however, the resulting url looks something like this:
http://newsite.com/subfolder/pageA-B.html/
instead of
http://newsite.com/subfolder/page-a/page-b/
why would my url redirect pass along the old path?
turns out, it's just an order of precedence. It seems that first rule:
turns into a catch-all immediately. Instead, the order needs to be reversed:
From what I gather, my original way saw that any path off the root was automatically matching the root as it was then passing along the old url as an argument essentially. but by reversing the order, it was a more explicit match which then took precedence since it was at the top of the list of urls it was trying to match.
not sure if i'm explaining this logic/order of operations correctly, but that's the best i can summarize this functionality at 4am =)