Welcome Guest, Not a member yet? Register   Sign In
Routing {locale} : Duplicate Content [SOLVED in next release]
#1

(This post was last modified: 06-30-2022, 07:38 AM by InstantT.)

Hi all,
When we use the "{locale}" tag in a route, it can generate Duplicate Content, even when using the $supportedLocales variable

For example if I use :
PHP Code:
public $supportedLocales = ['en''fr']; 


When I go to a url of type
- mywebsite.com/en/page.html = code 200 ("en" version)
- mywebsite.com/en/page.html = code 200 ("fr" version or "en" version if "fr" does not exist)
- mywebsite.com/lorem/page.html = code 200 ("en" version)
- mywebsite.com/codeignitertest/page.html = code 200 ("en" version) etc.

Do we have to check in our Controller that the language exists?
And if yes, how to get the information from the $supportedLocales variable?

Otherwise, wouldn't it be interesting in the next version, to put an option to avoid this duplicate content

For example, if {locale} does not correspond to any language present in $supportedLocales, then, we return a 404 error

Regards

Ps : The variable "$supportedLocales" is defined as "@var string[]"

What is the difference with "@var array"? (it's just for my personal culture Smile )
--- I am not a developer ---
Reply


Messages In This Thread
Routing {locale} : Duplicate Content [SOLVED in next release] - by InstantT - 06-29-2022, 10:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB