'; $js_or_css = pathinfo( $original_request, PATHINFO_EXTENSION ); // add multisite logic. $multisite = false; if ( true === $multisite ) { preg_match( '#\/([0-9]{1,5})\/(?:js|css)\/[a-z0-9]*_fallback\.(?:js|css)$#', $fallback_target, $child_site_id ); $ao_root_cache_dir = preg_replace( '#[0-9]*\/$#', '', $ao_cache_dir ); $ao_cache_dir = $ao_root_cache_dir . $child_site_id[1] . '/'; } $fallback_path = $ao_cache_dir . $js_or_css . '/fallback.' . $js_or_css; if ( $original_request !== $fallback_target && file_exists( $fallback_path ) ) { // error_log( 'Autoptimize file ' . $original_request . ' not found, using fallback instead.' ); header( 'HTTP/1.1 301 Moved Permanently' ); header( 'Location: ' . $fallback_target ); } else { // error_log( 'Autoptimize file ' . $original_request . ' not found, sending 410 gone response.' ); header( 'HTTP/1.1 410 Gone' ); } exit();