Forum Moderators: phranque
This uses an internal subrequest to do the check, so use it with care - it can impact your server's performance!
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !^(.+)\.asp$
RewriteRule ^(.*)$ - [G]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA]
</IfModule>
RewriteEngine On
RewriteRule \.asp$ - [G]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) index.php?url=$1 [QSA,L] RewriteCond %{REQUEST_URI} !^(images|styles|scripts)/
RewriteCond %{REQUEST_URI} !\.(png|jpe?g|gif|pdf|zip|txt)$ And I want to block all requests that contain .asp