Htaccess rewrite everything in index.html

I am trying to write a file .htaccessso that everything the user requests, he will have a pageindex.html

I wrote this:

Options +FollowSymlinks
RewriteEngine on
RewriteRule .* index.html [NC]

I understand that this will result in: no matter what the URL of the incoming request, i.e. www.domain.com/***(anything that comes after the slash), the result is a pagewww.domain.com/index.html

However, I get a server error. What am I missing?

NOTE. I don’t want it to be a constant redirect, I’m just trying to "hide" the contents of my site for several hours from this page index.html(which says that the site is under maintenance).

+5
source share
2 answers

Options +FollowSymlinks, php.ini.

+4

, :

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

R = 302

+12

All Articles