How do I change my .htaccess file to allow only my IP to sign into my website?

Asked by:
Kevalin / 8 Points
2013-05-31 1:02 am EST
I've been getting locked out of my website on and off for the last three days. Tried changing my htacces file for the site using the tutorials supplied by Webhostinghub. My htaccess page, however, looks COMPLETELY different from the one showed in the tutorial, and when I try to do what it says, I end up with a 500 Server error. The good news is, it knocks the dogs off my trail for a day, but then boom! I try to sign in and I get the "temporarily disabled" notice. ANY help in finally getting the htaccess page properly set up would be greatly appreciated!

To ask this user for more information, please first login.

To submit an answer, please login.

Best answer chosen by User


12,011 Points
2013-05-31 9:42 am EST
Hello Kevalin,

Thank you for our question. The contents of your .htaccess file will differ depending on your specific web design, or CMS.

The following code will block everyone from accessing the index.php file, except from IP address

#the following code prevents the display of the index.php file in a browser:
<files index.php>
order deny,allow
deny from all
allow from

I tested this successfully. If it is not working for you, try placing it on top of the .htaccess file (above the existing code).

If that doesn't work there may be something coded in your .htaccess file affecting it. You can troubleshoot this by renaming your .htaccess file something like:

Then create a new file called .htaccess, and put the allow,deny rules in it.

If you have any further questions, feel free to post them below.
Thank you,


To submit a comment on this answer, please first login.

Hi, John-Paul,
Right after I left here, I finally found out what I was doing wrong with the tutorial's instructions, so the problem SEEMS to be solved. However, I will definitely keep hold of your answer, not only for my future reference, but for those in my group who also have websites. Thanks SO MUCH for getting back to me... this is very handy information, indeed! :-)
8 Points

2013-05-31 4:37 pm EST
Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.