Announcement

Collapse
No announcement yet.

htaccess spammers and folder question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • htaccess spammers and folder question

    Hi,

    I have two .htaccess files on my website. One in the root and the other in the /forums folder.

    I want to write in code to deny access to a host. I have written this:

    order allow,deny
    deny from airtelbroadband.in
    allow from all

    I have only added this to the .htaccess file in the root. The .htaccess file in the /forums folder doesn't have any allow, deny conditions. Will this host still be denied access to the /forums folder or do I need to add the code to the .htaccess file in the /forums folder too?

    Thanks

  • #2
    Deny

    Hello netsultants,

    the .htaccess file in your root can deny IP's.
    Get their IP address and add it like this:
    Code:
    <limit GET>
    Order Allow,Deny
    Deny from 150.70.84.154
    </limit>
    
    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>
    You can also narrow down the ban by removing numbers from the right end.
    Example: the IP 150.70.84.154, can be done like this 150.70, and it will ban any IP that has 150.70 in the beginning.

    If this is in the root, it will keep them off the entire site if they access with that IP.

    There is also a more direct way to protect your other sensitive folders that requires more work, and the full path of your server, and also the creation of an encrypted password file (.htpasswd).
    Skydiving Forums - http://www.skydive-info.com/skydiving
    "If you don't know where you are going, you'll end up some place else." - Yogi Berra
    Home - http://www.Skydive-Info.com

    Comment


    • #3
      .htaccess files effect all sub-directories so having it only in the root will work just fine.

      Comment


      • #4
        Thanks guys....

        I knew that using a .htaccess file in the root would effect all subdirectories. I just wasn't sure if you have an .htaccess file in the subdirectory would it impact the .htaccess file in the root even if the one in the subdir doesn't have allow/deny info.

        Comment


        • #5
          Originally posted by netsultants View Post
          Thanks guys....

          I knew that using a .htaccess file in the root would effect all subdirectories. I just wasn't sure if you have an .htaccess file in the subdirectory would it impact the .htaccess file in the root even if the one in the subdir doesn't have allow/deny info.
          My pleasure netsultants,

          If you have not read my other posts in other threads, you can add an extra layer of protection in your admincp, modcp, includes, and your install directories.

          Each one of those directories can contain a .htaccess file with their own seperate .htpasswd (encrypted).

          It will require you to sign in to an additional username and password that is separate from the regular admin sign in.
          Skydiving Forums - http://www.skydive-info.com/skydiving
          "If you don't know where you are going, you'll end up some place else." - Yogi Berra
          Home - http://www.Skydive-Info.com

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X