RewriteCond %{REQUEST_URI} \.html$ [NC] RewriteRule (.*)\.html$ $1.php5 [L,QSA] RewriteCond %{REQUEST_URI \.php5 [NC] RewriteRule .* nonexistent.htm [L,R]