Issue URL formatting and Google indexing


#1

Hi,
I’m managing a website with different articles. These articles have tags attached to them (tagvalue1, tagvalue2, etc).
When the article is displayed, all its tags are displayed with hyperlinks whose values are like “www.website.com/tag/tagvalue1”.

Then when I click this link “www.website.com/tag/tagvalue1”, it opens "“www.website.com/tag/tagvalue1/”.
And that’s the page with all the articles that have this tag.
So it’s ok for me as a user/visitor.

-> Problem with Google indexing (inside the Google Search Console).
All the pages “www.website.com/tag/tagvalue1” are excluded from indexing because of “Page with redirect”.
Redirect because… “www.website.com/tag/tagvalue1” leads automatically to “www.website.com/tag/tagvalue1/” with a slash / at the end.

In my _config.yml, it have “permalink: pretty” and “permalink: /:categories/:title/”

  • removing the last / doesn’t change anything.
  • having “:title:output_ext” doesn’t change anything. Even along with “permalink:ordinal”

Obviously I missed something. But was searching for some time I couldn’t find anything. Where can I fix that?
Thanks in advance for your help!


#2

kinda sounds like you have the tag links hard coded with the slash at the end.
Also code be the web server not correctly removing the slash, how are you hosting the site?

Hard to tell anything without a link to the live site and a repo if available.


#3

Thank you for your input Ron.
You’re right, some of the URLs were generated automatically (those with the /) and others were hardcoded (at least the pattern - without the /) inside different includes templates.
My solution was to edit those templates and add the slash.
A bit ugly but I can’t spend that much time on such details. Let’s see what Google Search says in a few days after their next crawl.


#4

update: Google finally updated its indexing and everything is fine now.