Submit Your Article Forum Rules

Results 1 to 4 of 4

Thread: dot htaccess file

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    17

    dot htaccess file

    Not sure how to make a dot htaccess file. What I would like to do is use it to block ips to my host, and I am not sure how to do this. Anyone know how to do this and wouldn't mind explaining how to do this? Thanksf or any help.

  2. #2
    Senior Member
    Join Date
    Jan 2009
    Posts
    227

    Re: dot htaccess file

    You dont need to create .htacess file, it is a hidden file in your file manager... If your using cpanel, there is an option to block ips..

  3. #3
    WebProWorld MVP wige's Avatar
    Join Date
    Jun 2006
    Posts
    3,138

    Re: dot htaccess file

    An .htaccess file is a simple text file. To block IPs, create a file called .htaccess in your root folder (alongside your home page) that contains the following lines:

    Code:
    Order Allow, Deny
    Deny from 1.2.3.4
    Deny from 2.3.4
    Allow from All
    ErrorDocument 403 "Your IP Address has been blocked from accessing this server."
    This will allow all traffic, except that from the single IP address 1.2.3.4, as well as any IP address from 2.3.4.1-2.3.4.255. Blocked visitors will see the error message "Your IP Address has been blocked...". You can of course edit this message. However, you can not serve a custom error document, since access to that error document will also be blocked.

    Note: Using this code does require that your ISP allow you to customize your server using .htaccess, and the ErrorDoc line will only work if your ISP has enabled that functionality.
    The best way to learn anything, is to question everything.
    WigeDev - Freelance web and software development

  4. #4
    Junior Member
    Join Date
    Jan 2010
    Posts
    17

    Re: dot htaccess file

    Thanks very much, I will give it a try.

Similar Threads

  1. .htaccess file type for .asp
    By ldylion214 in forum Search Engine Optimization Forum
    Replies: 23
    Last Post: 12-01-2007, 11:41 PM
  2. .htaccess file type for .asp
    By ldylion214 in forum Web Programming Discussion Forum
    Replies: 5
    Last Post: 11-19-2007, 07:51 PM
  3. help regarding .htaccess file
    By SES Trims in forum Search Engine Optimization Forum
    Replies: 1
    Last Post: 12-26-2006, 07:48 PM
  4. help regarding .htaccess file
    By SES Trims in forum Google Discussion Forum
    Replies: 3
    Last Post: 12-08-2006, 05:59 PM
  5. Protecting .php file with .htaccess
    By milbrown in forum Web Programming Discussion Forum
    Replies: 2
    Last Post: 01-30-2006, 11:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •