Title: Issue with fallback CSS
Last modified: August 14, 2023

---

# Issue with fallback CSS

 *  Resolved [Gulshan Kumar](https://wordpress.org/support/users/thegulshankumar/)
 * (@thegulshankumar)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/issue-with-fallback-css/)
 * Hello! Frank, hope you’re very well.
 * While crawling site with ScreamingFrog I noticed 404 for the AO resources.
 * **Case 1. When I checked one URL manually, it returns 200 with CSS**
   Can’t seems
   to understand why there was 404 before but now 200 for same path?
 * **Case 2. For another URL, it returns blog archive with latest posts.**
   Ideally,
   it should be CSS or 404 not HTML page.
 *     ```wp-block-code
       Request URL: https://www.example.com/wp-content/cache/autoptimize/css/autoptimize_ab95e36a15f6054115f825914454b74f.css
       Request Method: GET
       Status Code: 404
       Remote Address: REDACTED:443
       Referrer Policy:
       strict-origin-when-cross-origin
       Cache-Control: no-cache, must-revalidate, max-age=0, no-store, private
       Content-Encoding: gzip
       Content-Type: text/html; charset=UTF-8
       Date: Mon, 14 Aug 2023 08:03:44 GMT
       Expires: Wed, 11 Jan 1984 05:00:00 GMT
       Location: /wp-content/cache/autoptimize/css/autoptimize_fallback.css
       Server: nginx
       Server-Timing: wp-load-alloptions-query;dur=2.52, wp-before-template;dur=45.93
       Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
   
       Vary: Accept-Encoding
       X-Redirect-By: WordPress
       X-Ua-Compatible: IE=edge
       ```
   
 * **I am using NGINX Helper. Do I need any special config?**
 * Sometimes Autoptimized JS/ CSS is referenced in cached HTML but is already removed,
   resulting in broken sites. With this option on, Autoptimize will try to redirect
   those not-found files to “fallback”-versions, keeping the page/ site somewhat
   intact. In some cases this will require extra web-server level configuration 
   to ensure `wp-content/autoptimize_404_handler.php` is set to handle 404’s in `
   wp-content/cache/autoptimize`.
 * Thanks & Regards,
   Gulshan

Viewing 1 replies (of 1 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/issue-with-fallback-css/#post-16970446)
 * Hey Gulshan;
    re. case 1; that can happen when a page in page cache points to
   an autoptimized file that is not there any more at first, but when the page in
   cache expires it is recreated in WordPress and that will also trigger AO to recreate
   the optimized file if it does not exist. root cause; something caused AO file(
   s) to be removed without clearing (all) the page cache(s).
 * re. case 2; that’s a problem with how WordPress is configured to handle “not 
   found” resources, normally this is a search page (and AO tries to hook in to 
   that process by [redirecting to the fallback CSS/ JS for URL’s that contain `cache/autoptimize`](https://github.com/futtta/autoptimize/blob/beta/classes/autoptimizeCache.php#L680-L713))
   but in this case it looks like something (the theme? a plugin) is redirecting“
   not found” to the blog archive.
 * hope this helps,
    frank

Viewing 1 replies (of 1 total)

The topic ‘Issue with fallback CSS’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/issue-with-fallback-css/#post-16970446)
 * Status: resolved