Viewing 9 replies - 1 through 9 (of 9 total)
  • I get 404 for both. Try to add “$” to the source pattern to match the wildcard all the way to the end of the URL.

    • This reply was modified 7 years, 3 months ago by Gal Baras.

    It works when you don’t put the extension on because WP’s php code is triggered and so the redirection plugin runs.

    I suspect that when you have a URL with the extension, then your web server attempts to serve it directly without running WP and so you get a 404.

    I see you are running an nginx server, so you will need to check your nginx configuration to see what happens when you do / do not have an extension.

    I have the same issue but what I have observed is that without the redirection I receive a WP 404 page, so WP code is definitely triggered.

    As soon as I add the redirection I receive a 404 but not from WP, it seems a standard 404 sent from the server without any visible content triggering an error message in the browser “This … page can’t be found”

    But when this happens hits are counted in the redirection plugin!

    This is weird, any ideas?

    Please provide full details of the urls and the redirects you have set up.

    Here are some more details and an example:

    Redirection Version 2.5

    The redirection is using the WordPress module (the other modules apache, nginx are not in use at all)

    Redirect type is 301
    source: /wp-content/uploads/2016/12/1612-n26-opengraph.png
    target: /content/uploads/2016/12/1612-n26-opengraph

    screenshot of the config:
    https://snag.gy/B6dxrq.jpg

    URL
    https://n26.com/wp-content/uploads/2016/12/1612-n26-opengraph.png

    Well the configuration looks correct, but it isn’t working. Have you tried setting wordpress debug on to see whether there are any error messages?

    Thread Starter tizimazza

    (@tizimazza)

    Like @eastdevonalliance said it looks like my server (nginx) is processing error pages with extensions, so even if i write a redirect it doesnt work cause it doesnt pass through wordpress system. Im looking with my server administrator to solve this. Im having problem with .jpg images and also with pages with inde.php in the end.
    Anyone knows what configuration to do on nginx server to pass all files trough wordpress redirection?

    I am not sure that you would want to do that as serving e.g. a jpg through wordpress is about 100x slower that just serving it.

    So you should look to try the nginx redirection functionality in this plugin.

    I actually have a similar problem (I only redirect the file name part) and have to create redirections manually in .htaccess. It’s annoying, but kinda makes sense not to involve WordPress in image redirection.

    The OP’s problem seems to be resolved now, but in theory, it could be resolved by configuring the Apache module and creating a redirection group that uses Apache to handle redirects.

    I’ve just tried this with a couple of my images and it didn’t work 🙁

    I’ve even tweaked the rewrite rules manually, but the only thing that seems to work is a “redirect” directive. I’m on LiteSpeed, but I had the same problem when I was on Apache, so that’s not the likely cause.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘cant redirect images url’ is closed to new replies.