• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.