I have a site which has only ONE file: index.html.
I just want to redirect everything except for http://www.mysite.com/ to http://www.mysite.com/.
That includes /index.html, somephonydir/, somefile.txt, you name it — I don’t care what it is, I just want to redirect to /.
I’ve tried the following:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/$
RewriteRule ^.*$ / [L]
This gives me a 500 Internal Server error.
I found the answer. I guess I forgot to actually tell it to redirect. 😉