I am doing some changes directly to the server on my WordPress website. I’ve modified the access file and I want all the users to be redirected excluding my IP. So basicly when I access the website I want it to work normally but when someone else access it I want it to be redirected to a maintenance page.
Here is my current .htaccess file which doesn’t work:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^89.137.131.186
RewriteCond %{REQUEST_URI} !^/maintenance/index\.php$
RewriteRule ^(.*)$ http://domain.com/maintenance/index.php [R=307,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Why use a redirect? Why not use this plugin: http://wordpress.org/extend/plugins/ultimate-maintenance-mode/
It’s what I use for Maintenance pages. All user’s who have logged in will be able to see the site as normal. All non-logged in users will see the maintenance screen which is customizable.