// List of extensions for static files
$exts = 'txt|png|gif|jpe?g|shtml?|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp|xml';
// It is not an imagecache path, which we allow to go through Drupal
if (!strpos($_SERVER['QUERY_STRING'], 'imagecache')) {
// It is not our main feed page
if ($_SERVER['QUERY_STRING'] != 'rss.xml') {
// Is it a static file?
if (preg_match('/\.(' . $exts . ')$/', $_SERVER['QUERY_STRING']))
// Just send a 404 right now ...
{
header('HTTP/1.0 404 Not Found');
print '<html>';
print '<head><title>404 Not Found</title></head>';
print '<body><h1>Not Found</h1>';
print '<p>The requested URL was not found on this server.</p>';
print '</body></html>';
exit();
}
}
}
Contents contributed and discussions participated by Daniel Gregoire
openscholar - 3 views
1More
Searchlight: A Views-driven Approach to Pluggable Search in Drupal | Development Seed - 5 views
1More
Example Varnish VCL for a Drupal / Pressflow site | Drupal - 1 views
3More