Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Sherry384

4 Comments

Sorted by latest first Latest Oldest Best

 

@Kaufman445

I once came up with a solution I call .htaccess maintenance mode.
It uses mod_rewrite, restricts the site to your IP address, and redirects other people to another URL.

RewriteEngine On

RewriteCond %{REMOTE_ADDR} !^192.168.1.100
RewriteCond %{REQUEST_URI} !^/403.html$
RewriteRule ^(.*)$ site.com/403.html [R=307,L]


A little explanation:
The first line checks the IP address. The third one redirects the user to the 403.html page. Basically it would redirect all pages to 403.html, including 403.html - the second line prevents that so users can't go into an endless redirect loop.

10% popularity Vote Up Vote Down


 

@Kristi941

For the sake of variety: if you have a static IP address you could block all IP addresses except yours:

order deny, allow
deny from all
allow from xxx.xxx.xxx.xxx


Just change xxx.xxx.xxx.xxx to be your IP address.

10% popularity Vote Up Vote Down


 

@Karen161

(on Apache Server)
Steps


Choose the directory you wish to protect You wish to protect the whole site then chose "public_html". Also chose a directory e.g. "../password" to store the password in.
Create a file .htaccess and .htpasswd
Edit .htaccess with your favourite editor to contain the following:



AuthUserFile /path/to/password/.htpasswd

AuthGroupFile /dev/null

AuthName "Authentication Query Name"

AuthType Basic



place .htaccess in to be protected folder
Edit .htpasswd to contain the username and passwords. Syntax [username]:[md5-encrypted-password] Use a generator to make the encryption e.g.


foobar:Fkb3n2r1vsba

place .htpasswd in chosen directory and make sure you change the directories permission so only the server may access e.g. run chmod g+r,g+x,o-r,o-x password

10% popularity Vote Up Vote Down


 

@Ann8826881

If you run an Apache server just make a .htpasswd file and upload it to your main directory.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme