I am trying to take my site offline for maintenance but only allow access to my IP address. However I can only ever manage to produce an internal server error. I don't understand how it exactly what i've done wrong. I want normal people to get my maintenance.php and for me to get the normal WordPress redirect rules and pages.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^maintenance\.php$ - [L] # Direct requests to maintenance.php should show file and stop
#RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC] # Give access to images on maintenance page
#RewriteCond %{REMOTE_ADDR} !^xxx\.xxx\.xxx\.xxx # My IP goes here
RewriteRule . /maintenance.php [R=302,L]
# Normal WordPress rules
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteBase /
to the beginning of your rewrite rules, or changing the last line toRewriteRule . maintenance.php [R=302,L]
. Otherwise, you're changing all your requests to //maintenance.php, a url that doesn't resolve anywhere.