• Resolved dtamajon

    (@dtamajon)


    Hi,

    I’m having a 404 error on my campaign. I have check the other “404 error” thread but could not solve my issue.

    My permalinks configuration is:
    Common: /%postname%/
    Product: product (default)

    I’m using nginx and any other navigation is working properly.

    Can you help me?

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor lusp

    (@lusp)

    Hi @dtamajon,

    Thank you for bringing this to our attention. We have tested the Cart Link plugin in a Lando-based nginx environment, trying to reproduce the issue you have described, unfortunately with no success at this point. This is why we believe it might be related to the non-standard/custom server configuration.

    To be able to troubleshoot it further, could you please provide us with some additional information on:

    – Currently used WP & WooCommerce versions
    – PHP version
    – server version

    Is the 404 error page displayed after using the campaign link a default WordPress one or is it coming from your hosting?

    Kind regards,
    Luke

    Thread Starter dtamajon

    (@dtamajon)

    Hi Luke!

    Following are versions being used:

    WP version: 6.1
    WooCommerce: 7.0.0
    Cart Link for WooCommerce: 1.1.2
    PHP: 8.1

    No other plugins installed

    What do you mean with “server version”?

    The 404 error is sent by the nginx server. You can check it here:
    https://wordpress.litesolutions.es/test/

    The nginx configuration is:

    location ~ \.php$ {
              try_files $uri $uri/ /index.php?$args =404;
              include /etc/nginx/fastcgi_params;
              fastcgi_pass 127.0.0.1:9021;
              fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
              fastcgi_read_timeout 900; #15 minutes
    }

    I can provide user/pass to the Wordress if you need it. This is a temporal installation just to test “Cart Link”.

    Thank you,
    Daniel

    Plugin Contributor lusp

    (@lusp)

    Hi @dtamajon,

    Thank you for providing us with additional information. Now, we are pretty sure that our previous suspicions were correct and the issue you have encountered is related to the custom server configuration.

    To be more precise, I’ll explain briefly how the Cart Link mechanisms work – the plugin allows to create your own custom redirection URLs, e.g., example.com/test, however, as you can see, this type of URL is reserved for WP page. This is why the plugin checks the URL matching and according to the results, it performs the defined actions when it detects the 404 for this particular URL (template_redirect action).

    To cut the story short, Cart Link is not able to perform the operation because it executes the server’s 404 instead of the WordPress one. In order to make it work properly, the server needs to be configured to point the WP 404 when reaching the https://wordpress.litesolutions.es/not-found/, not the server’s one as it is done at the moment.

    After the quick research we believe that the following instructions might be helpful in your case:

    https://mkyong.com/nginx/nginx-wordpress-404-errors-for-all-pages/

    and you should try to change the:

    try_files $uri $uri/ /index.php?$args =404;

    to

    try_files $uri $uri/ /index.php?$args;

    in your server setup.

    Kind regards,
    Luke

    Plugin Contributor lusp

    (@lusp)

    Since there are no further inquiries concerning this case I’m marking this thread as resolved.

    Kind regards,
    Luke

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘404 error on nginx’ is closed to new replies.