Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2009
    Location
    Saskatchewan, CDN
    Posts
    68
    Plugin Contributions
    0

    Default .htaccess file causes problem

    Hi everyone,

    I’ve got a question regarding .htaccess files. I followed the following guidance on putting together a .htaccess file.
    https://www.zen-cart.com/tutorials/index.php?article=73

    It recommended that I use the following code:

    #.htaccess to prevent unauthorized file access files
    OPTIONS -Indexes -ExecCGI
    IndexIgnore */*
    ### This part says to deny access to EVERYTHING. Afterwards, you'll allow access to JUST the permitted items. See next FilesMatch section.
    <FilesMatch .*>
    Order Deny,Allow
    Deny from all
    </FilesMatch>
    ### NOTE: Add only appropriate PERMITTED filetypes to this list, depending on which folder you're protecting:
    <FilesMatch .*\.(js|css|jpg|gif|png|swf)>
    Order Deny,Allow
    Allow from all
    </FilesMatch>


    After uploading the .htaccess file into the /images folder, it wasn’t visible in either my FTP program or in the cPanel file browser, but it did have an effect. When you clicked a product, the product image was broken and didn’t appear. At first, I wasn’t sure what the cause of this could be, but I made a .htaccess file that contained nothing, uploaded it to the same folder and the problem was SOLVED!

    I emailed my hosting company (Camelot-hosting) about .htaccess files. The service rep said, “Yes you can upload htaccess files ( make sure there are no php over rides in them )”

    Are there any php over rides in the above code? Also, does anyone know why my product images didn't work when I used the above code in my .htaccess file?

    Thanks!!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: .htaccess file causes problem

    Quote Originally Posted by jasonhoward64 View Post
    Hi everyone,

    I’ve got a question regarding .htaccess files. I followed the following guidance on putting together a .htaccess file.
    https://www.zen-cart.com/tutorials/index.php?article=73
    NOTE: If you're using the latest version of Zen Cart, then these .htaccess protections are already in place.
    Quote Originally Posted by jasonhoward64 View Post
    After uploading the .htaccess file into the /images folder, it wasn’t visible in either my FTP program
    That's likely because most FTP programs are configured by default to hide files starting with a "." in the filename. (The "." means "hidden" in most operating systems.)
    Quote Originally Posted by jasonhoward64 View Post
    When you clicked a product, the product image was broken and didn’t appear.
    Maybe you put it in the wrong place? Maybe you put a typo in it?
    Quote Originally Posted by jasonhoward64 View Post
    I made a .htaccess file that contained nothing, uploaded it to the same folder and the problem was SOLVED!
    That would be the same as deleting the .htaccess file itself.
    Quote Originally Posted by jasonhoward64 View Post
    Are there any php over rides in the above code?
    No.
    .

    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.

  3. #3
    Join Date
    Jun 2009
    Location
    Saskatchewan, CDN
    Posts
    68
    Plugin Contributions
    0

    Default Re: .htaccess file causes problem

    Thanks Dr. Byte.

    I think I've got everything working. I'm not sure if you'll see this, but I just want to know that you've changed my life with Zen Cart. For that, I thank you!

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: .htaccess file causes problem

    Thanks!
    Glad you got it sorted out!
    .

    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.

 

 

Similar Threads

  1. v151 What file or action causes attributes to be added to cart
    By kobra in forum General Questions
    Replies: 4
    Last Post: 4 Feb 2013, 01:23 AM
  2. Problem with .htaccess file
    By number5 in forum General Questions
    Replies: 4
    Last Post: 30 Sep 2009, 02:20 AM
  3. .htaccess in /public_html/ causes log-in failure
    By avidre in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 22 Mar 2009, 06:13 PM
  4. .htaccess causes internal server error
    By dannyd in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 13 Mar 2009, 06:30 PM
  5. Replies: 1
    Last Post: 16 Jan 2009, 01:47 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR