RewriteEngine on RewriteBase / RewriteRule ^DB/TE/(.+\.dat) /data/$1? [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME}index.html !-f RewriteRule . /index.html [L]