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.

Dani AI

Generated

Short practical plan: pick the single URL you want indexed (probably the new /y/ scheme), then implement server-side permanent redirects, update site links and the XML sitemap, and monitor via Search Console and your server logs. As noted, this is primarily a server/technical fix; was heading in the right direction with redirects but a temporary 302 is the wrong signal for a permanent structural move — use a permanent redirect. is correct that canonical signals help, but they are a hint and should not be the only remedy when two URLs serve identical content.

If your site serves .aspx pages, implement the redirect at the IIS level (URL Rewrite rules in web.config) so the old /x_y/ path permanently 301s to /y/ and query strings are handled consistently. That avoids leaving both versions live and immediately fixes future Analytics and search traffic. Test on a staging server and verify with a simple HTTP HEAD (curl -I) to confirm a single 301 and a clean Location header (no chains).

If editing every page template is impractical, you can inject canonical information at the server level (for example via an outbound rule that adds an HTTP Link header with rel=canonical) to provide directory-level canonical hints without changing markup. That is useful as an interim measure, but still not a replacement for 301s when pages are truly duplicated. Avoid blocking the old directory with robots.txt before redirecting — crawlers need to see the 301 to transfer signals.

Cleanup checklist: deploy 301 redirects, update all internal links and sitemap.xml, resubmit sitemap to Search Console, monitor indexation and crawl errors, watch Analytics (create a view/filter or use regex-based reports to merge historical old/new paths if needed), and check for redirect chains or broken links in external backlinks.

Recommended Answers

All 3 Replies

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...


... 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.