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.

I would suggest you post this in a more technical area of the forum than the marketing section. However, you can do REDIRECTS for all of those pages so you don't have them as identical duplicate content pages.

You can redirect those URL that you would not allow to SE. You will redirect those URL in htaccess file with 302 code.
After changes, you will upload in root directory.

In terms of SEO "/y/somepage.aspx?foo=bar&b=" is not a good URL for a page.

I would suggest you look into URL rewriting. It'll enable you to specify URLs for the same resource, but ones that are more descriptive and rich in keywords. Search engines and human visitors will love you for it!

rel link canonical is useful for resolving duplicate content issues. If you have pages with similar content you can indicate to search engines your preferred page.

For example if the two URLs below show identical content...

http://www.example.com/y/somepage.aspx?foo=bar&b=
http://www.example.com/do-something-useful

... you'd probably want the header of both pages to contain something like:

<link rel="canonical" href="/do-something-useful" />

You could possibly use a redirect to force visitors to visit the new URL instead, it wouldn't be difficult to set up, but would prevent you from accessing pages using the old url, the scheme you say matches your directory structure.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.