Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2008
    Posts
    340
    Plugin Contributions
    0

    Default Using .htaccess files to protect against unwanted snooping

    In zencart tutorials I read this:


    8. Use .htaccess files to protect against unwanted snooping

    In several folders, there are .htaccess files to prevent users from being able to browse through the files on your site unless they know exact filenames. Some also prevent access to any .PHP scripts, since it's expected that all PHP files in those folders will be accessed by other PHP files, and not by a browser directly. This is good for security. If you delete these files, you run the risk of leaving yourself open to people snooping around.


    There are also some blank index.html files in several folders. These files are there to protect you in case your FTP software won't upload .htaccess files, or your server won't accept them. These only prevent directory browsing, and do not stop execution of .PHP files. It's a good alternative, although using .htaccess files in all of these folders is the better choice, for servers that accept them.


    Suggested content for .htaccess files in folders where there is an index.html file but not yet an .htaccess file would be something like the following (depends on your server configuration):

    #.htaccess to prevent unauthorized directory browsing or access to .php files
    IndexIgnore */*
    <Files *.php>
    Order Deny,Allow
    Deny from all
    </Files>

    #add the following to protect against people discovering what version your spiders.txt file is
    <Files *.txt>
    Order Deny,Allow
    Deny from all
    </Files>


    What does zencart mean by that?

  2. #2
    Join Date
    Feb 2010
    Posts
    154
    Plugin Contributions
    0

    Default Re: Using .htaccess files to protect against unwanted snooping

    I have an additional question in regard to this, if someone could help me out?

    Following the above instructions, I have added:

    #add the following to protect against people discovering what version your spiders.txt file is
    <Files *.txt>
    Order Deny,Allow
    Deny from all
    </Files>

    into my /includes/.htaccess file.

    Might be a silly question this, to someone who understands .htaccess, but if this is preventing browsers from accessing spiders.txt, won't it also stop the spiders from accessing spiders.txt too?

    Cheers,
    C.

  3. #3
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,246
    Plugin Contributions
    58

    Default Re: Using .htaccess files to protect against unwanted snooping

    If you do this

    <Files *.txt>
    Order Deny,Allow
    Deny from all
    </Files>

    then the search engines (ALL) cannot request your robots.txt.

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  4. #4
    Join Date
    Feb 2010
    Posts
    154
    Plugin Contributions
    0

    Default Re: Using .htaccess files to protect against unwanted snooping

    Quote Originally Posted by mprough View Post
    If you do this

    then the search engines (ALL) cannot request your robots.txt.

    ~Melanie
    Melanie, thanks for confirming my suspicions. So are you saying that the above advice is wrong and that I should undo what it suggests?

    And if the advice is wrong, then how do I 'protect against people discovering what version your spiders.txt file is'? And why do I even care if people can discover what version my spiders.txt file is?

  5. #5
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,246
    Plugin Contributions
    58

    Default Re: Using .htaccess files to protect against unwanted snooping

    Suggest you simply remove default text files and chmod 444 the ones you require.

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  6. #6
    Join Date
    Feb 2010
    Posts
    154
    Plugin Contributions
    0

    Default Re: Using .htaccess files to protect against unwanted snooping

    Quote Originally Posted by mprough View Post
    Suggest you simply remove default text files and chmod 444 the ones you require.

    ~Melanie
    Not quite sure what you're telling me there Melanie.

    All I'm really concerned about are the security implications. The instructions in the first post of this thread (copied from the security thread) tells me to protect my spiders.txt file.

    I don't care much about other .txt files (unless I also read somewhere they could pose a security breach opportunity).

    My question though is whether the proposed changes to .htaccess also prevent the spiders themselves from reading the spiders.txt file? (which the setting 'deny all' suggests)

    Sorry for any confusion, and my long winded responses, but the original security fix doesn't even say what security is breached by people knowing my spiders.txt file version. It just seems common sense (I'm new to .htaccess) that 'deny all' should also block spiders, which I presumably don't want to do.

    Thanks,
    Celtic.

  7. #7
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,246
    Plugin Contributions
    58

    Default Re: Using .htaccess files to protect against unwanted snooping

    Quote Originally Posted by Celtic View Post
    My question though is whether the proposed changes to .htaccess also prevent the spiders themselves from reading the spiders.txt file? (which the setting 'deny all' suggests)
    Your spiders.txt is not requested by anyone except your Zen Cart.

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  8. #8
    Join Date
    Feb 2010
    Posts
    154
    Plugin Contributions
    0

    Default Re: Using .htaccess files to protect against unwanted snooping

    Quote Originally Posted by mprough View Post
    Your spiders.txt is not requested by anyone except your Zen Cart.

    ~Melanie
    Aha! Thanks Melanie, exactly what I needed to know.

    Much appreciated.
    Celtic

 

 

Similar Threads

  1. Protect my custom php files
    By solo_400 in forum General Questions
    Replies: 5
    Last Post: 18 Dec 2012, 05:27 PM
  2. Trying to password protect my site using .htaccess
    By nirvana10 in forum General Questions
    Replies: 2
    Last Post: 8 Sep 2011, 01:07 AM
  3. Secure php files without using htaccess?
    By 6thday in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 9 Jan 2010, 07:54 AM
  4. Using one applicatio against multiple databases
    By Benjamin Krajmalnik in forum General Questions
    Replies: 2
    Last Post: 22 Feb 2007, 03:14 AM
  5. Correct way to protect dirs and files?
    By LilleyPadGifts in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 31 Jan 2007, 06:19 AM

Posting Permissions

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