Pages with and without the trailing slash causing duplicate content issue

Hey @Jennifer_G! :wave:t2:

I think you’re seeing a couple of different things. I ran a request from my local command line for /calculator and it redirected straight to /hsa...etc/ so I think your current site should be fine :thinking:

Your second screenshot is seeing a 301 to /calculator/ but, importantly, from that tool’s cache. Note the first line “----Found in Cache----”. That just means that unless that tool clears its cache, it will always redirects from /calculator to /calculator/ without even reaching out to the Netlify servers. That’s probably due to your site having had content on /calculator/ at some point previously and Netlify automatically redirecting /calculator to /calculator/ per trailing slash stuff (we’ve chatted about that before). It’s not necessarily a bad thing in this case though because it just means another request will happen. When the browser (or your tool) reads a 301 from cache and goes instead to /calculator/, that will reach out to Netlify and get another redirect, this time to /hsa..etc/, and should take the user there.

You shouldn’t have ending up on /calculator/ in a browser or tool that follows redirects automatically.


Jon

@jonsully I arrive there in my browser (including incognito) as do some others on the marketing team (less technical than I)

What would the setting be? Could our customers also be seeing what I am seeing? I even see this in incognito and safari and chrome and firefox and on my mobile using mobile data only.

Perhaps it is an arm wrestling match to get to the destination and on some sides the wrong destination wins.

I feel like trying to add the trailing slash potentially unleashes some oddities for sure!

Thanks!

Hm. Yeah to be fair, and standing at odds to my last response, if I put https://livelyme.com/calculator/ in my address bar and hit enter, I too get the normal calculator page and not the (fancy!:sparkles:) /hsa-savings-calculator/ page.

Could you try changing your redirect from:

/calculator /hsa-savings-calculator

to:

/calculator/ /hsa-savings-calculator/

I’m not sure that’ll do the trick but it may.


Jon

I see where your head is at with this suggestion (at least I think so :wink: ) so essentially the “automatic” path today is

/calculator → /calculator/ so if I want it to make the hop to /hsa-savings-calculator/ I need to be more specific in ALL of my redirects to include the trailing slash in the primary path and redirect path since the trailing slash redirect will happen in lieu of the actual server redirect?

I think that post from @trayoutes is spam; and I’m suspicious that that person’s whole profile is in it of itself spam :thinking: @perry

Anywho, you’re on my line of thinking correctly :stuck_out_tongue: but I don’t know whether that’s certain thing or just a hunch, so I’d say let’s try it with this one route / path and see if it works before changing all of them :sweat_smile:

Any luck on that one @Jennifer_G?

Hi @jonsully we found that there is a mistake in our next.config.js file and the route was still calculator to /hsa-savings-calculator. We updated the route to be /hsa-savings-calculator to /hsa-savings-calculator and deleted the calculator.js file from our project.

Seemed to fix the issue but not sure which fix ultimately worked.

1 Like

Nice! Probably the next.js stuff — adding or removing a trailing slash in a _redirect isn’t supposed to do anything if I recall correctly, which is why I was hesitant to suggest it as a solution… more of just a “maybe this’ll do it?” :stuck_out_tongue: Glad we found the solution there!

1 Like

@jonsully I am glad you confirmed my suspicion that trailing slashes in redirects doesn’t do anything and appreciate your help on this. Lucky to have your input thanks!