Skip to content

Instantly share code, notes, and snippets.

@GeekPress
Created April 25, 2018 13:02
Show Gist options
  • Save GeekPress/97ff5cb1a796c962a2e151f71a248679 to your computer and use it in GitHub Desktop.
Save GeekPress/97ff5cb1a796c962a2e151f71a248679 to your computer and use it in GitHub Desktop.
.htaccess skip WordPress 404 error handling for static files
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(robots\.txt|sitemap\.xml(\.gz)?)
RewriteCond %{REQUEST_FILENAME} \.(css|js|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ [NC]
RewriteRule .* - [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment