• oleksandrmelnychenko

    (@oleksandrmelnychenko)


    Hi!

    We updated our WP version to the latest one (6.5.3). After that, we encountered various glitches throughout our website (the navigational menu wasn’t working, fonts changed, links weren’t active, etc.). We tested it internally and discovered that those issues were related to the Autoptimize plugin settings. In particular, they appeared when we switched on CSS and JS code optimization. In these cases, the following errors (500 Internal Server Error) appear in the DevTools console:

    curl 'https://104.197.4.9/wp-content/cache/autoptimize/js/autoptimize_single_4eca121cfb354e9b8cbf358773b23a09.js' \
      -H 'Accept: */*' \
      -H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
      -H 'Authorization: Basic Y3N1c2VyOmF2MTAx' \
      -H 'Connection: keep-alive' \
      -H 'Cookie: cs_custom_cookie=https%3A%2F%2F104.197.4.9%2F; gcl_au=1.1.1602272903.1716981448; ga=GA1.1.1380220482.1716981448; gid=GA1.1.434397399.1716981451; gat_UA-69354283-2=1; _ga_CJSE8BGE9N=GS1.1.1716981448.1.1.1716981639.25.0.0' \
      -H 'Referer: https://104.197.4.9/' \
      -H 'Sec-Fetch-Dest: script' \
      -H 'Sec-Fetch-Mode: no-cors' \
      -H 'Sec-Fetch-Site: same-origin' \
      -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' \
      -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "macOS"' \
      --insecure

    We also encountered 5 more errors, but when I put them here the message is reported as spam.

    What are your recommendations? What can cause those issues?

    Currently, we tested all of the above in our dev website.

    Best regards,

    Alex

Viewing 3 replies - 1 through 3 (of 3 total)
  • Optimizing Matters

    (@optimizingmatters)

    hey Alex; the pasted code is a (curl) request, but I see no information on the response so hard to say what’s happening there.

    What I would do;
    1. check the webserver & PHP errorlog for relevant errors
    2. check if something in .htaccess is causing issues here
    3. check if the files (e.g. wp-content/cache/autoptimize/js/autoptimize_single_4eca121cfb354e9b8cbf358773b23a09.js) are on the filesystem or not
    4. test if the problem persists after clearing both Autoptimize’s & any page cache you might have

    feel free to follow up with your findings!

    frank (ao dev)

    Thread Starter oleksandrmelnychenko

    (@oleksandrmelnychenko)

    Hi! We see bunch of these errors in the log:

    [Fri May 31 15:00:37.222155 2024] [core:alert] [pid 86112] [client 89.64.52.96:56066] /var/www/html/wp-content/cache/autoptimize/.htaccess: Require not allowed in <Files> context, referer: https://104.197.4.9/singapore/singapore-company-registration/
    [Fri May 31 15:00:37.411434 2024] [core:alert] [pid 86108] [client 89.64.52.96:56017] /var/www/html/wp-content/cache/autoptimize/.htaccess: Require not allowed in <Files> context, referer: https://104.197.4.9/singapore/singapore-company-registration/
    [Fri May 31 15:01:12.066620 2024] [core:alert] [pid 86114] [client 89.64.52.96:23885] /var/www/html/wp-content/cache/autoptimize/.htaccess: Require not allowed in <Files> context, referer: https://104.197.4.9/

    HT access is this:

    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    

    3. This file doesn’t exists wp-content/cache/autoptimize/js/autoptimize_single_4eca121cfb354e9b8cbf358773b23a09.js

    4. Yes, problem was still here.

    Best regards,

    Alex

    can you copy/ paste the contents of wp-content/cache/autoptimize/.htaccess here as well Alex?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘500 Internal Server Error when CSS an JS codes optimization enabled’ is closed to new replies.