I've noticed one bot in particular in our log files that rearranges query parameters when scanning our website. This got me thinking. Does allowing rearranging of query parameters trigger duplicate content penalties with legitimate bots? Because technically, there could be multiple urls that result in identical content because of this. Example:
https://example.com?te=one&tr=two&page=1
https://example.com?tr=two&te=one=page=1
https://example.com?page=1&te=one&tr=two
https://example.com?page=1&tr=two&te=one
https://example.com?te=one&page=1&tr=two
https://example.com?tr=two&page=1&te=one
Obviously this could go further depending on how many query parameters exist. I have a little script that disallows rearranging of query parameters (it issues a 404 if they enter query parameters in the wrong order). I'm just not sure if I should be using that script to issue a 404, or doing a 301 pointing to the correct order url, or using canonical tags pointing to the correct order url.
Thanks, Todd
.htaccess
(or server config) via a 301 redirect. Not that you should necessarily do this sort of thing in.htaccess
, but the script is easy to implement/extend and naturally works across the entire site, so it may have its uses. It would also be trivial to change it to a 404 if you wanted.