Skip to content

Instantly share code, notes, and snippets.

@casivaagustin-zz
Created June 9, 2015 20:08
Show Gist options
  • Save casivaagustin-zz/68477788550aa5e0cce2 to your computer and use it in GitHub Desktop.
Save casivaagustin-zz/68477788550aa5e0cce2 to your computer and use it in GitHub Desktop.
Fast 404 Settings
//In the settings.php add at the end.
include(dirname(__FILE__) . '/fast404.inc');
// Add a file fast404.inc in the same folder than settings.php
$fast_404_page = dirname(__FILE__) . '/themes/fast_404.html'; #//Setup this 404 page.
include_once('./sites/all/modules/contrib/fast_404/fast_404.inc'); //Set the path
$conf['fast_404_allow_anon_imagecache'] = TRUE;
$conf['fast_404_exts'] = '/\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp|php|html?|xml)$/i';
$conf['fast_404_html'] = file_exists($fast_404_page) ? file_get_contents($fast_404_page) : '404';
$conf['fast_404_path_check'] = TRUE;
$conf['fast_404_url_whitelisting'] = TRUE;
$conf['fast_404_HTML_error_all_paths'] = TRUE;
$conf['fast_404_whitelist'] = array(
'index.php',
'rss.xml',
'install.php',
'cron.php',
'update.php',
'xmlrpc.php'
);
$conf['fast_404_string_whitelisting'] = array(
'cdn/farfuture',
'/advagg_',
'sitemap',
'user',
'admin',
'node',
'file/ajax',
'content',
'404',
'imce',
'rss.xml',
'feed',
'taxonomy',
'queue',
//Add your safe paths here
);
if (fast_404_ext_check() !== TRUE) {
fast_404_path_check();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment