- [ X ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- [ X ] The issue still exists against the latest
master
branch of Polylang and the latest WordPress version. - [ X ] This bug happens with only Polylang plugin active
- [ X ] This bug happens with a default WordPress theme active
- [ X ] I can reproduce this bug consistently
Steps to reproduce the issue
- Ubuntu 20.04 + nginx + mysql 8 + latest woordpress + permalinks + subdomain + polylang with subdomain option + cloudflare dns proxy
1.2. Open WP dashboard at domain.com -> add new post for the language your subdomain.domain.com is at -> write something in the post -> preview -> open in new tab
1.3. You are taken to subdomain.domain.com/p=2342, where in turn you are greeted with a WP 404 page not found. The preview has been generated at domain.com/p=2342. You are able to access the preview, by typing the domain.com/p=2342 manually.
- Ubuntu 20.04 + nginx + mysql 8 + latest woordpress + permalinks + subdomain + polylang with subdomain option
2.2. Open WP dashboard at domain.com -> add new post for the language your subdomain.domain.com is at
2.3. Paste a link of subdomain.domain.com/any-post-link-url-encoded-transliteration
2.4. The woordpress link generator can’t process the link of the subdomain.domain.com/any-post-link-url-encoded-transliteration and receive a metainfo about the post
Expected behavior and actual behavior
- Post preview link takes to subdomain.domain.com instead of domain.com, where the link is generated.
- for the oembed link to open a modal showing the usual picture and metainfo about the post from the subdomain.domain.com site, while writing a post.
Any guidance would be very appriciated.
I didn’t find anything related to this issue nor on stackoverflow, nor on woordpress, nor here among issues, nor polylang github.
I have searched through all the posts in all the places polylang listed on their github readme, also.
What I have already tried to solve your issue
- Preview link
1.1. unsuccessful nginx, .htaccess and php header rewrites
1.2. nginx proxy for subdomain.domain.com to domain.com
1.3. expanding server_name directive with the subdomain.domain.com in a nginx server block
1.4. unsuccessful attempts at finding of the url creator/initiator function in wp-admin, wp-includes and wp-content folders. All of them returned domain.com, so I don’t know where and how the redirect link is chosen.
1.5. serving subdomain.domain.com and domain.com in seperate nginx server blocks
1.6. in wp dashboard -> language -> settings -> url modification -> switching between subdomain option, vs custom domains -> entering the same domains. Everything stays the same, but still both issues remain.
- Oembed
2.1. Added a oembed provider in functions.phpwp_oembed_add_provider( 'https://subdomain.domain.com/*', 'https://domain.com/oembed/', false );
2.2.
2.3. The endpoint at which the oembed is requested from the new post frontend is https://rutest.mainampasauli.news/wp-json/oembed/1.0/proxy?url=https://rutest.mainampasauli.news/hukuygiuygiuyg/&lang=ru&_locale=user So I tried a couple of urlencoded and regular permutations with this request. Unsuccessful.
Thank you. Any help would be very appriciated.