RewriteEngine On RewriteRule ^([^.]*).xml$ /get_xml/file/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^.][^/]*)/ /$1\.php [L] RewriteRule ^([^.]+)$ /$1\.php [L] RewriteRule ^([^.]*)\.html /$1\.php [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !(.css|.js)$ RewriteRule ^(.*)(.php)$ /error404_doc/$1/ [L]