Deny access to site in development, locally and remote
Posted: Wed Jul 15, 2009 8:42 am
After developing a site locally, the next stage is putting it on the real server but only allowing access to myself or a limited number of people. Using htaccess seems like a convenient thing to do that
However, what is the correct way to do that if I want to use the same htaccess file locally as well as on the remote server.The reason I'd like to use the same file is to be able to update all files/synchronize all files without having to think about which file to update and which not
Something like this?
In which I put my real IP on the place of 12.345.678.987
However, what is the correct way to do that if I want to use the same htaccess file locally as well as on the remote server.The reason I'd like to use the same file is to be able to update all files/synchronize all files without having to think about which file to update and which not
Something like this?
Code: Select all
# deny all except those indicated here
<Limit GET POST PUT>
order deny,allow
deny from all
allow from 127.0.0.1
allow from localhost
allow from 12.345.678.987
</Limit>