Want to redirect all visitors except for me

前端 未结 4 789
别跟我提以往
别跟我提以往 2021-02-01 07:24

Basically I\'m about to start work on a site and I\'d like something that I can add into my .htaccess file (or elsewhere) that\'ll work like this pseudo code: (my ip will be in

4条回答
  •  星月不相逢
    2021-02-01 07:56

    Be careful with this approach.

    I've gotten burned by taking the IP based approach to limiting access, and then losing the lease on my IP address.

    Of course you can always ssh into the box in question and change the .htaccess file again, but the 5 minutes of panic while you try to figure out what just happened aren't exactly fun if you aren't expecting it to happen.

    I recommend instead using the .htaccess (in conjunction with an htpasswd file) to request credentials for accessing your development site.

    A good example of that is here: http://aplawrence.com/foo-web/htaccess-authentication.html

提交回复
热议问题