Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    It’s not working I’m afraid Korhan :-/

    The way to test; look at the HTML source of a page of your site, find a link to an autoptimized file (e.g. https://socio.events/wp-content/cache/autoptimize/js/autoptimize_ef5eab5c108effa5bf18caa597fcb115.js) and change one letter (or number) in the URL. If it works you’ll see it being redirected to https://socio.events/wp-content/cache/autoptimize/js/autoptimize_fallback.js, but in this case I seem to get a blank page with the “410 Gone”-HTTP response.

    Thread Starter fboylovesyou

    (@fboylovesyou)

    My hosting company is Wpengine and I saw your plugin on their suggested optimize plugins. Do you have any idea how to setup nginx server on wpengine to catch this broken css or js files.

    I sent them this code to setup server:

    location ~* /wp-content/cache/autoptimize/.*\.(js|css)$ {
        try_files $uri $uri/ /wp-content/autoptimize_404_handler.php;
    }

    but you say that it doesn’t work. do you have any idea to solve this issue?

    Thread Starter fboylovesyou

    (@fboylovesyou)

    related article on WPEngine
    https://wpengine.com/resources/wordpress-plugins-site-optimization/

    your plugin is at the top of this list but unfortunately it is not working properly on their servers

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Afraid I’m not a nginx specialist and as such the code is merely an example which did work on an nginx server I have access to, but I have no idea why it would not work on wp engine korhan, sorry. You could alternatively ask them to ensure 404’s are handled by WordPress instead of nginx, in which case AO will intervene for missing Autoptimize files?

    Thread Starter fboylovesyou

    (@fboylovesyou)

    I realized that redirection works successfully on server but the php handler file can not get the REQUEST_URL.

    I added some codes to the autoptimize_404_handler.php file and I wrote all server variables to screen, but I can not get the request url. here are all server variables I can find, so the handler file returns a 410 header.

    do you have any suggestion to fix this issue?

    PHP_SELF	/wp-content/autoptimize_404_handler.php
    argv	-
    argc	-
    GATEWAY_INTERFACE	CGI/1.1
    SERVER_ADDR	127.0.0.1
    SERVER_NAME	dsocioevents.wpengine.com
    SERVER_SOFTWARE	Apache
    SERVER_PROTOCOL	HTTP/1.0
    REQUEST_METHOD	GET
    REQUEST_TIME	1625082750
    REQUEST_TIME_FLOAT	1625082750.93
    QUERY_STRING	
    DOCUMENT_ROOT	/nas/wp/www/sites/dsocioevents
    HTTP_ACCEPT	text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
    HTTP_ACCEPT_CHARSET	-
    HTTP_ACCEPT_ENCODING	gzip, deflate, br
    HTTP_ACCEPT_LANGUAGE	en-US,en;q=0.9
    HTTP_CONNECTION	close
    HTTP_HOST	dsocioevents.wpengine.com
    HTTP_REFERER	-
    HTTP_USER_AGENT	Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
    HTTPS	on
    REMOTE_ADDR	31.223.2.252
    REMOTE_HOST	-
    REMOTE_PORT	45378
    REMOTE_USER	-
    REDIRECT_REMOTE_USER	-
    SCRIPT_FILENAME	/nas/wp/www/sites/dsocioevents/wp-content/autoptimize_404_handler.php
    SERVER_ADMIN	[no address given]
    SERVER_PORT	80
    SERVER_SIGNATURE	
    PATH_TRANSLATED	-
    SCRIPT_NAME	/wp-content/autoptimize_404_handler.php
    REQUEST_URI	/wp-content/autoptimize_404_handler.php
    PHP_AUTH_DIGEST	-
    PHP_AUTH_USER	-
    PHP_AUTH_PW	-
    AUTH_TYPE	-
    PATH_INFO	-
    ORIG_PATH_INFO	-
    Thread Starter fboylovesyou

    (@fboylovesyou)

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    hah, REQUEST_URI is /wp-content/autoptimize_404_handler.php, whereas normally it would be autoptimize/css/autoptimize_5b956debcda2f84587cc5dceaa716c.css … no idea why that is happening I’m afraid fboylovesyou, might be specific to how wpengine’s nginx is set up :-/

    asking to have 404’s handled by WordPress would probably be the easiest workround?

    Thread Starter fboylovesyou

    (@fboylovesyou)

    For a solution I cancelled the php handler file and update server code lines like this below and now it is working fine ??????

    location ~* /wp-content/cache/autoptimize/.*\.(css)$ {
        try_files $uri $uri/ /wp-content/cache/autoptimize/css/autoptimize_fallback.css;
    }
    
    location ~* /wp-content/cache/autoptimize/.*\.(js)$ {
        try_files $uri $uri/ /wp-content/cache/autoptimize/js/autoptimize_fallback.js;
    }
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    that is actually a nice alternative solution, I’ll add it to the FAQ! ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How can I test “enable 404 fallbacks” option?’ is closed to new replies.