• Resolved szymcio

    (@szymcio)


    Hi,
    After enabling CSS combine or JS combine or even Lazy Load Images the min.xxxx.css or min.xxxx.js files are in status 404. As you can see:
    https://ibb.co/dxaTg9

    The link to GTmetrix. Files are in “Avoid bad request” section:
    https://gtmetrix.com/reports/slowit.pl/2J60z3Az

    I tried to exclude my css/js theme files but it did not help.
    wp-content/themes/cenote

    My httaccess file:

    # BEGIN LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    <IfModule LiteSpeed>
    RewriteEngine on
    CacheLookup on
    RewriteRule .* - [E=Cache-Control:no-autoflush]
    RewriteRule ^min/\w+\.(css|js) - [E=cache-control:no-vary]
    
    ### marker CACHE RESOURCE start ###
    RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
    ### marker CACHE RESOURCE end ###
    
    ### marker FAVICON start ###
    RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
    ### marker FAVICON end ###
    
    </IfModule>
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END LSCACHE
    # BEGIN NON_LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    ### marker MINIFY start ###
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} ^(.*)/min/(\w+)\.(css|js)$
    RewriteCond %1/wp-content/cache/$2/$1.$2 -f
    RewriteRule min/(\w+)\.(css|js) wp-content/cache/$2/$1.$2 [L]
    </IfModule>
    ### marker MINIFY end ###
    
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END NON_LSCACHE
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    How can I fix this?

    Thanks
    Szymon

    • This topic was modified 7 years, 7 months ago by szymcio.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Could you please verify in your WP setting , that both URL section are same of HTTP or HTTPS , don’t leave it as one HTTP and another HTTPS ?

    Best regards,

    Thread Starter szymcio

    (@szymcio)

    Hi qtwrk,
    Thanks for reply. I have set up https url in WordPress main settings. Unfortunately it did not help. Please check screen:
    https://ibb.co/cvPNR9

    I have also added below code to .htaccess file

    RewriteCond %{HTTP_HOST} slowit\.pl [NC]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://slowit.pl/$1 [R,L]

    What I noticed: the min file is available under:
    https://slowit.pl/index.php/min/0a9fe.css

    And the page 404 error is under:
    https://slowit.pl/min/0a9fe.css

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    This looks like rewrite rule problem.

    Could you please try , go to permalink , set to “plain” and see how it goes? and then change it to any other form , or your previous , and see how it goes?

    Best regards,

    Thread Starter szymcio

    (@szymcio)

    Hi,

    When I changed to plain permalinks the html code was correct -> 200. But when I switched to any other than plain the 404 error appears.

    Do you know how could I solve this? Using the plain option is not good for SEO.

    Thanks
    Szymon

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Please submit a ticket here, we will need to dig it deeper.

    Best regards,

    Thread Starter szymcio

    (@szymcio)

    Hi! Disabling the nginx server is the resulation.

    Thanks for help

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    If you wish to keep nginx on , please try convert that part of rewrite rule into nginx conf.

    Best regards,

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

The topic ‘404 status for css and js files’ is closed to new replies.