Need help with Apache .htaccess

Seem like I can't do even the simplest rewrite rules without Expert help ... I have the following in DOCUMENTROOT/.htaccess:

RewriteEngine On
RewriteCond ^/$1 !-eq /index.html
RewriteRule ^.*$ /index.html [L,R]

The idea is that any page requested which is NOT index.html gets redirected to index.html. My rewrite doesn't work. Yes, I have rewrite_module loaded. Yes, I restarted Apache.

Linux Slackware 14.1, kernel 3.14.24-smp, Apache 2.4.10.
LVL 1
MarkAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mukesh YadavFull Stack DeveloperCommented:
Try this:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/index.html$
RewriteRule .* /index.html [L,R=302]

Source:-
http://stackoverflow.com/questions/17709500/how-to-redirect-all-pages-only-to-index-html-using-htaccess-file-and-not-redirec

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MarkAuthor Commented:
That did it! Sheesh! I wish I could figure these out on my own.

Thanks a bunch!
MarkAuthor Commented:
Sorry to revisit this, but your solutions is, in fact, not quite working. I have some images (.jpg, .png) in this webpage and with the rule you gave me they are not showing. I suppose it appears to initially work because the images were cached in my workstation.

How would I modify this to permit images? Alternatively, I could incorporate .html and .jsp into the RewriteCond.

Any help would be appreciated because this page is live NOW!
MarkAuthor Commented:
I'll make a new question ...
Mukesh YadavFull Stack DeveloperCommented:
No need to make a new question

Use following code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/index.html$
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js)$
RewriteRule .* /index.html [L,R=302]

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.