Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Google Page Indexing errors - duplicate pages (added slash, plus index.php?, etc.)
#1
I recently discovered that Google Search Console has a whole list of duplicate pages for pages on my site. Thankfully, they are not indexed, but I'm curious how to make the pages entirely unreachable.

In all cases, the canonical is correctly set to the first URL example, so that's good and probably why Google is not indexing the alternates, but making the alternate URLs unreachable will remove these indexing errors from Google Search Console.

In my settings, Use Fancy URLs is checked, and my Custom Permalink Structure is %parents%/%slug%

Correctly indexed URL:
https://www.mysite.com/about

Alternate, accessible URLs that I'd like to make inaccessible:
https://www.mysite.com/about/ (has an added trailing slash)
https://www.mysite.com/index.php?id=about
https://www.mysite.com/about?lang=en

As a test, I tried unremarking out the # define('GSCANONICAL', 1); line in gsconfig.php, but that broke my site entirely. Just trying to go to this /about page, the URL in my web browser changed to:
https://www.mysite.com/%parents%/about
which is not found... so I assume having "parents" vs "parent" in my custom permalink structure breaks if you have that GSCANONICAL setting enabled.

Ignoring that gsconfig.php setting above, I assume I'm able to handle these situations in my htaccess file, but I'm not great with editing this file, so maybe someone already has the code? What I assume is the relevant section that I currently have in my htaccess file is this:
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]

Thanks in advance for anyone who can help.
Reply




Users browsing this thread: 1 Guest(s)