• Resolved stanley48

    (@stanley48)


    Hello, I need some help with Litespeed rewrite after minify CSS and JS files included Load Google Font Async to ON.

    I got errors 404 Not Found for :
    1. http://domain/min/css_async.js
    2. so many http://domain/min/randomtext.js
    3. other else http://domain/min/randomtext.css

    I was make sure that is problem from rewrite with accesing each link above using :
    http://domain/index.php/min/xxxxxxx.js or .css
    and it’s work.

    I’m not changing anything on my .htaccess file especially for Litespeed cache plugin .htaccess

    In my .htaccess, only this lines it’s not included on Litespeed wp cache plugin.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    Note : I cannot provide my link, because still using IP Address to setup the wordpress

    • This topic was modified 8 years ago by stanley48.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Could you please provide full htaccess content ?

    Best regrds,

    Thread Starter stanley48

    (@stanley48)

    Hi qtwrk,

    This is the .htaccess content

    # 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 LOGIN COOKIE start ###
    RewriteRule .? - [E="Cache-Vary:wp-postpass_2c7d48c23ed124744ae3fe9325ddeaa14d7"]
    ### marker LOGIN COOKIE 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
    
    # 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
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Could you please check webserver log, php log and LSCWP debug log ?

    And also please check permission and owner of your website folder.

    That looks like minified/combined JS/CSS file failed to be generated/saved into disk.

    Best regards,

    Thread Starter stanley48

    (@stanley48)

    Hi,

    Could you help me ?
    Where I can find that webserver log and also php log on lsws ?

    Permission for wp-content is 0755.

    Thread Starter stanley48

    (@stanley48)

    btw, where is the file would saved ?

    I had some files on my

    /wp-content/cache/css/
    - randomtext.css
    /wp-content/cache/js/
    - randomtext1.js
    - randomtext2.js
    - randomtext3.js
    

    I cannot find css_async.js on my /js/ folder, but still can access directly using
    http://domain/index.php/min/css_async.js

    And I also tried to access : http://domain/index.php/min/randomtext1.js
    It’s still working.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    It should be under wp-content/cache.

    If you saw files there , then this should not be a permission issue.

    Are all css/js files failed to load? or partially ?

    Best regards.

    Thread Starter stanley48

    (@stanley48)

    Hi,

    All css & js minified, included css_async.js are failed to load.

    I think this problem on rewrite, but I’m not familiar with .htaccess

    because link are generated by Litespeed Cache :

    http://domain/min/css_async.js and others.js got status 404

    but I try to access with including index.php it’s working.
    http://domain/index.php/min/css_async.js and got minified content

    Best Regards

    Thread Starter stanley48

    (@stanley48)

    Hi, I was make sure this is actually from my .htaccess redirection.

    Because I cannot accessing my post or pages domain.com/link

    Could you please check my .htaccess ? is there anything wrong ?

    I was enable rewrite on my virtual host, but not add extra rewrite rules there, only on my .htaccess

    • This reply was modified 8 years ago by stanley48.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    May I know what is your webserver ?

    Best regards,

    Thread Starter stanley48

    (@stanley48)

    • This reply was modified 8 years ago by stanley48.
    Thread Starter stanley48

    (@stanley48)

    solved.

    • This reply was modified 8 years ago by stanley48.
    uybueno

    (@uybueno)

    How did you solve it, my friend? I have the same problem, when using minify, it gives 404

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

The topic ‘Minify CSS & JS got 404 because rewrite condition’ is closed to new replies.