Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2006
    Posts
    197
    Plugin Contributions
    1

    Default How to create .htaccess files?

    Hi,

    As per item 7 of the site security recommendations I am trying to set up .htaccess files to secure my site. I have determined that my host enables cascading .htaccess files. Now I would like to create and upload a .htaccess file.

    My questions is: how do I create this file? Do I simply paste:
    #.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>
    into a file and save it and then upload it? Do I simply name it .htaccess?

    Thanks for your help,

    Nate

  2. #2
    Join Date
    Jun 2006
    Location
    Koh Samui
    Posts
    122
    Plugin Contributions
    0

    Default Re: How to create .htaccess files?

    Quote Originally Posted by bgroup99 View Post
    Hi,

    My questions is: how do I create this file? Do I simply paste:
    into a file and save it and then upload it? Do I simply name it .htaccess?
    Nate
    Hi Nate.

    You are correct. This is exactly how to do it
    Please check that the apache user does not have write access.

    For more info regarding .htaccess purpose and syntax etc.
    http://en.wikipedia.org/wiki/Htaccess

    Ronald.
    Last edited by azrahn; 10 Oct 2006 at 12:53 PM. Reason: addition
    [FONT="Verdana"]http://www.xlventures.eu[/FONT]

  3. #3
    Join Date
    Aug 2006
    Posts
    197
    Plugin Contributions
    1

    Default Re: How to create .htaccess files?

    Quote Originally Posted by azrahn View Post

    Please check that the apache user does not have write access.
    Thanks for your help Ronald. Just one follow up question: how do I check that the apache user does not have write access? Who is the apache user?

    Thanks,

    Nate

  4. #4
    Join Date
    Jun 2006
    Location
    Koh Samui
    Posts
    122
    Plugin Contributions
    0

    Default Re: How to create .htaccess files?

    Hi,

    The apache user is the account the apache webserver is using.
    Which account is being used depends on your webserver setup.
    If you chmod to 644 all wil be fine

    Ronald.
    [FONT="Verdana"]http://www.xlventures.eu[/FONT]

  5. #5
    Join Date
    Aug 2006
    Posts
    197
    Plugin Contributions
    1

    Default Re: How to create .htaccess files?

    Hi and thanks again.

    I created a .htaccess, which I have attached to this message. (I had to rename it to htaccess.txt to attach it).

    I uploaded this file to my root directory as my host has cascading enabled and set CHMOD to 644.

    Nate
    Attached Files Attached Files

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: How to create .htaccess files?

    If you uploaded that to your "root" directory, then you should find that your store stops working immediately.

    You blocked *.php with that, so "index.php" should be disabled.


    So ... if "root directory" means in your "public_html" folder, then you should not be able to access your index.php, meaning your site will be inaccessible. If that's the case then at least you know the file is "working" ... but in the wrong place.
    Follow the security guidelines for the appropriate places to put these restrictions.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Aug 2006
    Posts
    197
    Plugin Contributions
    1

    Default Re: How to create .htaccess files?

    Yeah, I found that out the hard way. I moved the .htaccess file to admin/includes and now everything seems to be working.

    Thanks,

    Nate

 

 

Similar Threads

  1. How can I create new directories and files from Admin?
    By bluesky1992 in forum Customization from the Admin
    Replies: 9
    Last Post: 3 Oct 2011, 03:01 AM
  2. how do i create the two configure php files?
    By kevinmorong in forum Installing on a Windows Server
    Replies: 3
    Last Post: 27 Jun 2010, 09:10 PM
  3. Regarding .htaccess Files.
    By philip56 in forum General Questions
    Replies: 2
    Last Post: 2 Apr 2008, 10:05 PM
  4. .htaccess Files
    By jayson.gurney in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 3 Sep 2006, 11:17 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
  •  
disjunctive-egg