• Resolved fedus

    (@fedus)


    Dear all,

    I have installed a fresh copy of WordPress 5.1.1 on NGINX 1.14.0 (Ubuntu 18.04) and PHP7.2.

    It seems to run quite well, but some minor issues remain, for which I have not been able to find a solution despite intensive googling.

    First issue:
    When I am on the pages site, and I click “Trash” for a given page, the page gets deleted successfully but the redirect provided in the response header goes to https://mydomain.com/?trashed=1&ids=37 (for example), whereas the actual WP installation sits on https://mydomain.com/a/wp . Permalinks work correctly and the settings for the WP and Site address are correct.
    What could I be missing here?

    Second issue:
    When I am logged in, and click “Preview” for a given page, and then in the preview click “Customize” on the WP admin header, the sidebar for customization shows up as expected. However, when I then click the “X” to close the sidebar, again I get directed to the root of the domain, instead of staying on the page preview or possibly being redirected to the page admin panel.
    Again, what could be the cause?

    Thank you very much for your help and support. I’d be more than happy to provide whatever code or config snippets are necessary.

    Best

    • This topic was modified 5 years, 12 months ago by fedus.
    • This topic was modified 5 years, 12 months ago by fedus.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    OK, so your installation is in /a/wp/ subfolder. Will mydomain.com alone get me to your WP home page? Or do I need to do mydomain.com/a/wp/? if the domain alone will get me to you home page, unless you have redirects setup for all requests, the the WP URL in settings should be https://mydomain.com/a/wp and only the site URL should be https://mydomain.com. Maybe this is what you have, or maybe you thought what is correct is different than this. I just wanted to be sure.

    The other thing strange is the response header example you provided is missing some important data. It seems that some plugin or theme code somewhere is corrupting location header paths somehow. Try installing and activating the health check plugin. Enter troubleshooting mode and see if the redirects work correctly now.

    If so, restore your normal configuration by using the admin bar troubleshooting item. Restore one at a time, testing after each. When things go wonky again, the last activated module is the cause.

    Thread Starter fedus

    (@fedus)

    Hey bcworkz,

    thanks for your reply!

    You have to navigate directly to mydomain.com/a/wp – it is a test installation and to keep it simple, we housed it in that subfolder and both the WP and Site address in the settings are set to mydomain.com/a/wp.

    I have installed the troubleshooting plugin, and the redirect after trashing a page still does not work. When I am on the page list, the link to trash a page points to https://mydomain.com/a/wp/wp-admin/post.php?post=3&action=trash&_wpnonce=1a56657c9f (for example). I can click it, the post is trashed, but then the response header contains a location: https://mydomain.com/?trashed=1&ids=94. It also contains x-redirect-by: WordPress, so it’s definitely WordPress adding it.

    The same behaviour happens with the standard theme. It’s really weird, it seems to run 99% as expected but small glitches like this are still throwing people off at the moment.

    Any help is appreciated – thanks already!

    • This reply was modified 5 years, 12 months ago by fedus.
    Moderator bcworkz

    (@bcworkz)

    In that case both the WP and site URL settings should include the /a/wp/ path. The URL that is used to construct the location redirect header comes directly from the “siteurl” option, set by the Site URL setting.

    Actually, before “siteurl” isused, WP tries to get the redirect path from the $_SERVER[‘HTTP_REFERER’] value sent by your browser slong with the trash page request. Only when there is no referrer does WP use “siteurl”. Verify that the Referer: header sent with the trash request is supplied and is correct.

    this same issue happens on 4.9 with a live site, no sub folders. On randoms ites deleting or cloning a page redirects to the home page

    EDIT: resolved by quitting safari and opening/logging in again!

    • This reply was modified 5 years, 11 months ago by sguk.
    Thread Starter fedus

    (@fedus)

    Dear all,

    I found the problem. When I checked the referrer that the browser sent, I realised that the webserver’s referrer policy was set to strict-origin. I could luckily afford to change it to same-origin, which solved the problem by sending the full url as referrer instead of only the origin.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP 5.1.1: Clicking “Trash” for a page wrongly redirects to domain root’ is closed to new replies.