Apache maintenance redirect
<ifmodule mod_rewrite.c="">RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^255\.255\.255\.255$ #IPv4
RewriteCond %{REMOTE_ADDR} 0000:0000:0000:0000:0000:0000:0000:0000 #IPv6
RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif|svg|css|js) [NC]
RewriteRule .* /maintenance.html [R=302,L]</ifmodule>
3 Replies
You welcome to use this script and make any edits for your own needs.
I confirmed this by checking my router's System Log - IPv6 Network Information. Each computer on the network had a different IPv6 address. I also tested it by changing the IP address for that other machine and it showed the normal site.
Hopefully if you're using my script or something similar and you're running into this issue, this will save you many hours of trouble shooting. I'll be looking into a solution for using multiple IP's and update the documentation.