File Editor
Directories:
.. (Back)
cache
et-cache
jetpack-waf
mu-plugins
newfold-page-cache201901
newfold-page-cache4JUdGzvrMFDWrUUwY3toJATSeNwjn54LkCnKBPRzDuhzi5vSepHfUckJNxRL2gjkNrSqtCoRUrEDAgRwsQvVCjZbRyFTLRNyDmT1a1boZV
newfold-page-cacheALFA_DATA
newfold-page-cacheAdminuploads
newfold-page-cacheAssets
newfold-page-cachePublic
newfold-page-cacheSite
newfold-page-cache_all_dbs
newfold-page-cache_wel-knownpki-validation883d551d-7523-4JUdGzvrMFDWrUUwY3toJATSeNwjn54LkCnKBPRzDuhzi5vSepHfUckJNxRL2gjkNrSqtCoRUrEDAgRwsQvVCjZbRyFTLRNyDmT1a1boZV
newfold-page-cacheabout
newfold-page-cacheadmincontrollerextensionextension
newfold-page-cacheadmincontrollerextensionextensionALFA_DATA
newfold-page-cacheadmincontrollerextensionextensionalfacgiapi
newfold-page-cacheadmincontrollerextensionextensioncgialfa
newfold-page-cacheadmineditor
newfold-page-cacheadminfckeditoreditorfilemanager
newfold-page-cacheadminimagesslider
newfold-page-cacheadminuploads
newfold-page-cacheadminuploadsimages
newfold-page-cachealfacgiapi
newfold-page-cacheassets
newfold-page-cacheassetsimages
newfold-page-cacheauthorkcreeves
newfold-page-cachebackup
newfold-page-cacheblog
newfold-page-cachecategoryuncategorized
newfold-page-cachecgialfa
newfold-page-cachecommentsfeed
newfold-page-cachecomponents
newfold-page-cachecontact-us
newfold-page-cachefeed
newfold-page-cachefeedatom
newfold-page-cachefiles
newfold-page-cacheimages
newfold-page-cacheimagesstories
newfold-page-cacheinclude
newfold-page-cachelocal
newfold-page-cachemodules
newfold-page-cachenew
newfold-page-cacheold
newfold-page-cachephp
newfold-page-cacheplugins
newfold-page-cacheprivacy-policy
newfold-page-cacheproject
newfold-page-cacheserver
newfold-page-cacheshop
newfold-page-cachesitesdefaultfiles
newfold-page-cachesitesdefaultfilesALFA_DATA
newfold-page-cachesitesdefaultfilesalfacgiapi
newfold-page-cachesitesdefaultfilescgialfa
newfold-page-cachesystem
newfold-page-cachetelescoperequests
newfold-page-cachetemp
newfold-page-cachetemplate
newfold-page-cachetemplatesbeez3
newfold-page-cachetemplatesbeez3ALFA_DATA
newfold-page-cachetemplatesbeez3alfacgiapi
newfold-page-cachetemplatesbeez3cgialfa
newfold-page-cachetest
newfold-page-cachethis-is-a-test
newfold-page-cacheupload
newfold-page-cacheuploadimage
newfold-page-cacheuploads
newfold-page-cachev2_catalog
newfold-page-cachevendor
newfold-page-cachevendorphpunitphpunitsrcUtilPHP
newfold-page-cachewordpress
newfold-page-cachewp
newfold-page-cachewp-contentALFA_DATA
newfold-page-cachewp-contentalfacgiapi
newfold-page-cachewp-contentcacheautoptimize+pin_link+
newfold-page-cachewp-contentcgialfa
newfold-page-cachewp-contentmu-plugins-old
newfold-page-cachewp-contentpatior
newfold-page-cachewp-contentpluginsbackup-backupincludes
newfold-page-cachewp-contentpluginsninja-forms
newfold-page-cachewp-contentthemesclassicinc
newfold-page-cachewp-contentuploadsALFA_DATA
newfold-page-cachewp-contentuploadsalfacgiapi
newfold-page-cachewp-contentuploadscgialfa
newfold-page-cachewp-includesALFA_DATA
newfold-page-cachewp-includesTextDiffEngineEngine
newfold-page-cachewp-includesalfacgiapi
newfold-page-cachewp-includescgialfa
newfold-page-cachewp-includeshtml-api
plugins
themes
upgrade
upgrade-temp-backup
uploads
Files:
autoptimize_404_handler.php
index.php
Create New File
Create
Edit File: autoptimize_404_handler.php
<?php /** * Autoptimize's magic 404 handler. * * Configure your webserver to have requests for files that are no longer in * /wp-content/cache/autoptimize/ to redirect to this file. AO's .htaccess file * will have a "Errordocument:" directive to automatically do this. * * This file has simple logic to redirect to the "fallback" files that are * created automatically by AO to avoid visitors seeing broken pages or * Googlebot getting utterly confused. * * Error logging is off by default (don't want to flood your php errorlog, but * can be enabled by this code snippet: * * add_filter( 'autoptimize_filter_cache_fallback_log_errors', '__return_true' ); * * Warning: the fallback files might not apply to all pages, so this is a just * a temporary solution, you really should clear any page cache to avoid requests * to files that don't exist in AO's cache. */ $original_request = strtok( $_SERVER['REQUEST_URI'], '?' ); if ( strpos( $original_request, 'uucss/uucss-' ) !== false ) { $original_request = preg_replace( '/uucss\/uucss-[a-z0-9]{32}-/', 'css/', $original_request ); } $fallback_target = preg_replace( '/(.*)_(?:[a-z0-9]{32})\.(js|css)$/', '${1}_fallback.${2}', $original_request ); $ao_cache_dir = '/home3/kcreeves/socialsecurityprimer.com/wp-content/cache/autoptimize/'; $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 . '/autoptimize_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();
Save Changes
Rename File
Rename