Welcome Guest, Not a member yet? Register   Sign In
Localization duplicate page problem when locale set in routes
#1

Hello everyone!

When we set locale in routes as says localization manual:

PHP Code:
$routes->get('{locale}/books''App\Books::index'); 

We get a problem when any URLs with any words in the locale segment become available: example.com/any_word/books

For example, your demo page https://website2.codeigniter.com/en/download can be also opened as https://website2.codeigniter.com/anyotherword/download
or https://website2.codeigniter.com/anything/download

This creates a big problem of duplicate pages in search engines. It is better that such pages return 404 errors

We can solve this problem by comparing first segment with supportedLocales. But this will not work if we do not need to specify the locale for the default language in routes.

How can we fix it correctly?
Reply


Messages In This Thread
Localization duplicate page problem when locale set in routes - by Stormbringer - 01-22-2020, 06:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB