I have a weird anomaly with one project. Where Google is indexing sites like:


While it should do it like:


I just recently added canonical tags, so ultimately it should use those right?

And I think the problem is also in my page display script. So it doesn't give 404, if the format isn't correct. However.. How on earth does Google even get to those links?

Is it because of <a href="/post/1-foobar.html">Example</a>? And also I had baseurl set in the head. And it somehow, thinks its a directory and goes on and on.

I have set all my links <a href="http://example.com/post/1-foobar.html">Example</a> now. But I really don't see the point, its just an extra bytes to load..

1 Answer 1


When you have a URL in the page without a nofollow, loaded directly, it is most likely that Google will follow it. In your case, when Google is following it, it is being served with a page by your script, so it is not entirely Google's fault. You have really two options here:

  1. Add a canonical link. You mentioned that you have already done that.

  2. Add a rel=nofollow to the link on your page that is generating these URLs. So Google will no longer follow it, at least for your new pages.

  3. In order to remove the already indexed pages from Google, file a page removal request at Google Webmaster Tools.

These are workarounds. The ideal solution is to prevent such things from happening, by making the relative URL an absolute one and preventing your script from serving a page when some one accesses a URL that does not exist. This has mostly likely lead to some duplicate content on your page, and solving this should be one of your top priority issues.

  • Yeah, I'm rewriting the URL handler, so it would detect wrong formats and show the 404. In that case, the crawler should stop and go back and rethinking, where it is heading. Commented Jul 24, 2014 at 17:46
  • 1
    Edit:this will lead to duplicate content on your site, but your site won't be penalized for it. googlewebmastercentral.blogspot.in/2008/09/… Commented Jul 24, 2014 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.