Code to Redirect to Maintenance Page Htaccess-
let’s say your maintenance page is located at yoursite.com/maintenance.html, then you need to add the following code to your .htaccess file:-
# Redirect all traffic to maintenance.html file
RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123
RewriteRule $ /maintenance.html [R=302,L]