About a month ago our developer changed the URL for all the programmed pages; before they were all /x_y/somepage.aspx?a=1&b=2&z=7&h= for example and that was changed to /y/somepage.aspx?foo=bar&b= (the relevant part being the first section in bold). However all the pages are still accessible via /x_y/... (which is the actual name of the directory on the server). Therefore, we have a duplicate URL problem there for all pages. In Google Analytics we're seeing both versions of any given page.
So how to clean this up? Would specifying a canonical URL (link rel="canonical" tag in head) do the trick? Is there any way to do that sort of thing at the directory level, rather than having our programmer add that to every page?
Would much appreciate some insight from any of you SEO wizards out there, thanks.