Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter cozz13

    (@cozz13)

    No because of the reverse proxy. The redirects aren’t automatically writing /blog onto the front because it looks like it’s using the relative URL to redirect.

    The redirects work on the subdomain pre-proxy on the subdomain, but they don’t work on the subdirectory site because there’s no way for WordPress or your plugin to know http://www.website.com/blog exists as it’s all done by nginx.

    Here’s what’s happening when you change a URL at the moment on our actual site:

    The actual site URL of our WordPress site: https://www.sg.website.com

    ..which is reverse proxied to the customer-facing site: https://www.website.com/blog

    This is what currently happens:

    Before slug changed:
    https://www.website.com/blog/test-old-url

    Current behaviour when slug changed:
    https://www.website.com/blog/test-old-url
    301: Permanent redirect to https://www.website.com/test-new-url
    404: Page not found https://www.website.com/test-new-url

    Expected behaviour when slug changed:
    https://www.website.com/blog/test-old-url
    301: Permanent redirect to https://www.website.com/blog/test-new-url
    200: OK https://www.website.com/blog/test-new-url

    Here’s a screenshot from the Redirects screen https://imgur.com/a/PZzlJHE so it is tracking the change correctly, but nginx isn’t rewriting the redirect to have /blog on the front so it’s assuming the slug hangs off the root. Nginx isn’t catching and rewriting it so l’m hoping to bypass the need for changes to the config (apologies: I’m not a dev or devops so I’m kind of winging it here).

    Hopefully that makes more sense? Should I be asking devops to come up with a way to catch and rewrite redirects instead?

    Thread Starter cozz13

    (@cozz13)

    Almost, but not quite. The closest thing you have would be Options > URL Monitor Changes. In your example and that part you create a second redirect and add /amp to the end of the url. I’m looking for that, but I want to add /blog to the start of the URL.

    Thread Starter cozz13

    (@cozz13)

    Ah sorry I’ll try to clarify.

    If I add a redirect manually to your tool it works perfectly. The issue I have is that when an editor changes the slug of a page (usually without telling anyone), I need to add a redirect manually for the correct URL to resolve otherwise the old URL ends up 404ing.

    I’m looking for a solution that removes the need for this manual step and allows me to explicitly say “every single slug changed on a page or post needs to have a destination URL that starts with https://www.website.com/blog … then… /new-slug-path-goes-here-on-the-end

    Hopefully that makes more sense?

Viewing 3 replies - 1 through 3 (of 3 total)