Home Page Strange Canonical Redirect
-
I was digging into a strange problem where, if you are setup to use a static home page and you are using using_permalinks
$wp_rewrite>using_permalinks()
then the home page will redirect for query params that do not match expectations.Namely I think that the worst offender is that a url like
http://example.com/?param=
always redirects tohttp://example.com/?param
without the equals sign.I dug through the wordpress code some more to see that there was an else block added https://github.com/WordPress/WordPress/commit/12c0b72d9e5d5e97cac05d81094b615507094639 to redirect only the home page if it matched the
page_on_front
option.
And that
https://github.com/WordPress/WordPress/commit/0906863d2c96dec97e80b6fb9b7730852cf1007f#diff-8a59b7fef1419a7d41ee6f4eef8fa5784a9cf991ac7d2c7b0616819b5fed5168R657
Is for some reason turning ‘param=’ into ‘param’ without the equals sign.This all seemed very strange to me, and also seems like maybe it was unexpected. I was wondering if this would be considered a bug?
I think that it should be okay to link to
http://example.com/?param=
without getting a 301 redirect especially because you can link tohttp://example.com/category1/?param=
just fine without getting a redirect.
- The topic ‘Home Page Strange Canonical Redirect’ is closed to new replies.