www.webdeveloper.com
Results 1 to 2 of 2

Thread: Put site under maintenance but allow my IP to access

  1. #1
    Join Date
    Apr 2011
    Posts
    13

    Put site under maintenance but allow my IP to access

    So during a maintenance, here's what I would have in my .htaccess file:
    RewriteEngine On
    RewriteBase /
    Code:
    RewriteCond %{REQUEST_URI} !^/maintenance\.php$
    RewriteCond %{REMOTE_HOST} !^888\.888\.888\.888
    RewriteRule ^(.*)$ maintenance.php [L]
    Don't mind the 8's, that's where my IP would go.

    So the site goes into maintenance perfectly, but I can't access it either.

    I've searched around Google for answers, but it seems to work fine for everyone else.

    For the RewriteCond, I don't know whether I should be using REMOTE_HOST or REMOTE_ADDR, but I've tried them both and they both don't work.

    Can anyone help me to allow my IP to access my site during a maintenance?

  2. #2
    Join Date
    Apr 2010
    Posts
    88
    Try

    RewriteCond %{REMOTE_ADDR} !^888\.888\.888\.888$
    RewriteRule ^(.*)$ maintenance.php [R=503,L]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles