I have a Laravel website running behind nginx, and I am trying to understand the correct way to handle URLs with a trailing slash.
For example, there can be two possible versions of the same page:
/en/
and:
/en
At the moment, the version with the trailing slash redirects to the version without the trailing slash.
So:
/en/
redirects to:
/en
The root URL stays unchanged:
/
I am not sure if this is the correct setup, or if both versions should return the same page.
My concern is that allowing both versions may create duplicate URLs for the same content, but redirecting one version means that tools such as Google Search Console may report the redirected URL as “Page with redirect”.
As far as I could check, my internal links use URLs without the trailing slash.
Should trailing-slash URLs redirect to the non-trailing-slash version, or should both versions return 200 for the same page?