There was a problem loading the comments.

How to restrict access to your site using .htaccess except your IP address?

Support Portal  »  Knowledgebase  »  Viewing Article

  Print
How to restrict access to your site using .htaccess except your IP address?

Restriction in .htaacess file applies to any IP address, including yours.  Find out your IP address using tools like "What Is My IP Address" and create an exception for yourself.

Make sure that your IP address is static, not dynamic, so you wouldn’t have to change it in the .htaccess file frequently.

In the next step, you need to find .htaacess file.

1. Login into your cPanel account.

2. Click on „File manager“ in the „File“ section

3. In the right top click on „Settings“.
4e0007d7b70ae78fef227486b8df8e8dc58e7dd4?t=ba10a157ddc051e79c77e8ecd935031f
4. Mark „Show hidden settings (dotfiles)“
4e9b52c5305b1af96ff9f5f47345b18ddf01f881?t=dca20e04e4be48c099f0dcf56c4c81b4

5. Find the .htaacess file, default dirrectory , that is home/public_html, but it may be differ depending the settings. Wen you found the file click on it with right mouse button and choose „Edit“.
f46ae7da621377f5190704f5fc9d8faa49573d0d?t=d9c790a7bc9ac8a75e428aef50194a4a
6. Now, let’s place the deny from all command in the .htaccess file. Add the following code snippet to the top of the file if you want to block all access except yours (replace <your ip> with your IP address to create the exception):
4d4aeddfd16b2a6ee08c8c7fbf727b6bf8f2c0c2?t=60c0b642f8230e00c6a1669d14f7e225
7. Click on „Save changes“.

Note: To remove restrictions, just delete the inserted lines of the rule from the document and save the changes.

Share via
Did you find this article useful?  

Related Articles


Comments

Add Comment

Replying to  

Captcha
© Getspace - EU