Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#54758 new defect (bug)

Front page not embeddable when using a static page_on_front

Reported by: dd32's profile dd32 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Canonical Keywords: has-patch has-unit-tests needs-testing
Focuses: Cc:

Description (last modified by dd32)

When a site is configured with a page_on_front, Canonical kicks in and redirects the user to the homepage.

This is caused by Canonical not being embed-aware.

As an example, the WordPress.org homepage should be embeddable:

$ curl -Is https://en-au.wordpress.org/embed/ | grep -E '^(HTTP|location)'
HTTP/2 301
location: https://en-au.wordpress.org/

The non-pretty embeds do however work, unfortunately WordPress doesn't link to these when rewrites are enabled:

$ curl -Is https://en-au.wordpress.org/?embed=1 | grep -E '^(HTTP|location)'
HTTP/2 200

After the PR attached to this ticket:

$ curl -ILs https://en-au.wordpress.org/embed/ | grep -E '^(HTTP|location)'
HTTP/2 200

The fix attached is a combination bugfix/enhancement, as I've fixed the bug by making canonical embed aware, so it redirects to the canonical embed location.

The PR isn't complete, as it appears to still fail on one of the test-cases I added, and appears to have altered (Potentially fixed?) the behaviour of another canonical test.

A more targeted fix would be to disable canonical when is_embed() is truthful.

Change History (2)

This ticket was mentioned in PR #2120 on WordPress/wordpress-develop by dd32.


3 years ago
#1

  • Keywords has-patch has-unit-tests added

#2 @dd32
3 years ago

  • Description modified (diff)
  • Keywords needs-testing added
Note: See TracTickets for help on using tickets.