Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Aug 2012
    Location
    Kitty Hawk, NC
    Posts
    55
    Plugin Contributions
    0

    Default Uppercase JPG image files 403 Forbidden

    Hello,

    I've made some changes lately, switching hosts being one. Now my images with uppercase JPG are 403 Forbidden. There are too many to manually change; is there a rewrite I can add in the .htaccess file? Or is there another solution?


    Thank you!
    Gina

  2. #2
    Join Date
    Jul 2012
    Posts
    16,748
    Plugin Contributions
    17

    Default Re: Uppercase JPG image files 403 Forbidden

    The images directory has an .htaccess file in it (hidden file) that contains a list of extensions that are acceptable. Because JPG is different than jpg, the uppercase (or any combination of upper and lower case) is effectively denied.

    Would need to add JPG and other such uppercase extensions to the list(s) within that file and in similar places such as the templates directory as seen fit.

    Ultimately/ideally those files should be renamed and the database reference to them should be modified (relatively easy to do with a sql statement) and future files should only be uploaded with the lower case.

    On a side note, image handler 5 has recently been rewritten to *not* be able to work with uppercase extensions.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,595
    Plugin Contributions
    88

    Default Re: Uppercase JPG image files 403 Forbidden

    Quote Originally Posted by mc12345678 View Post
    The images directory has an .htaccess file in it (hidden file) that contains a list of extensions that are acceptable. Because JPG is different than jpg, the uppercase (or any combination of upper and lower case) is effectively denied.

    Would need to add JPG and other such uppercase extensions to the list(s) within that file and in similar places such as the templates directory as seen fit.

    Ultimately/ideally those files should be renamed and the database reference to them should be modified (relatively easy to do with a sql statement) and future files should only be uploaded with the lower case.

    On a side note, image handler 5 has recently been rewritten to *not* be able to work with uppercase extensions.
    Not true. The change to IH-5 disallows the mixture of .jpg and .JPG files for a product.

  4. #4
    Join Date
    Aug 2012
    Location
    Kitty Hawk, NC
    Posts
    55
    Plugin Contributions
    0

    Default Re: Uppercase JPG image files 403 Forbidden

    In the image htaccess file, I added JPG to the code below but it didn't change anything:

    <FilesMatch "(?i).*\.(jpe?g|gif|webp|png|swf)$" >

  5. #5
    Join Date
    Aug 2012
    Location
    Kitty Hawk, NC
    Posts
    55
    Plugin Contributions
    0

    Default Re: Uppercase JPG image files 403 Forbidden

    This is the whole image htaccess file:


    #
    # @copyright Copyright 2003-2013 Zen Cart Development Team
    # @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    # @version GIT: $Id: Author: DrByte Fri May 17 14:29:18

    2013 -0400 Modified in v1.5.2 $
    #
    # This is used with Apache WebServers
    #
    # The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved

    exceptions
    # It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
    # Will also prevent people

    from seeing what is in the dir. and any sub-directories
    #
    # For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in

    your apache/conf/httpd.conf file.
    # Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is

    not specified.
    # Example:
    #<Directory "/usr/local/apache/htdocs">
    # AllowOverride Limit Options Indexes
    #</Directory>
    ###############################

    # deny *everything*
    <FilesMatch ".*">


    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    Order Allow,Deny
    Deny from all
    </IfModule>
    </FilesMatch>

    # but now allow just *certain*

    necessary files:
    <FilesMatch "(?i).*\.(jpe?g|gif|webp|png|swf)$" >

    <IfModule mod_authz_core.c>
    Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
    Order Allow,Deny
    Allow

    from all
    </IfModule>
    </FilesMatch>

    IndexIgnore */*


    ## NOTE: If you want even greater security to prevent hackers from running scripts in this folder, uncomment the following line (if your

    hosting company will allow you to use OPTIONS):
    # OPTIONS -Indexes -ExecCGI



    ##################
    ## Optional caching improvements
    ## Requires mod_headers to be enabled within Apache
    ##################
    <IfModule mod_headers.c>
    Header unset Pragma
    FileETag None
    Header unset ETag
    <FilesMatch "(?i).*\.(jpe?g|gif|webp|png|swf)$">
    Header set Cache-control "max-

    age=864000, public, must-revalidate"
    Header unset Last-Modified
    </FilesMatch>
    </IfModule>

  6. #6
    Join Date
    Jul 2012
    Posts
    16,748
    Plugin Contributions
    17

    Default Re: Uppercase JPG image files 403 Forbidden

    Well that got all hosed up... Will repost so that can ensure that text breaks are in the correct location and the content is correct.
    Last edited by mc12345678; 17 Jul 2018 at 06:29 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jul 2012
    Posts
    16,748
    Plugin Contributions
    17

    Default Re: Uppercase JPG image files 403 Forbidden

    Quote Originally Posted by enchanted1 View Post
    This is the whole image htaccess file:


    #
    # @copyright Copyright 2003-2013 Zen Cart Development Team
    # @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    # @version GIT: $Id: Author: DrByte Fri May 17 14:29:18

    2013 -0400 Modified in v1.5.2 $
    #
    # This is used with Apache WebServers
    #
    # The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved

    exceptions
    # It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
    # Will also prevent people

    from seeing what is in the dir. and any sub-directories
    #
    # For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in

    your apache/conf/httpd.conf file.
    # Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is

    not specified.
    # Example:
    #<Directory "/usr/local/apache/htdocs">
    # AllowOverride Limit Options Indexes
    #</Directory>
    ###############################

    # deny *everything*
    <FilesMatch ".*">


    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    Order Allow,Deny
    Deny from all
    </IfModule>
    </FilesMatch>

    # but now allow just *certain*

    necessary files:
    <FilesMatch "(?i).*\.(jpe?g|gif|webp|png|swf)$" >

    <IfModule mod_authz_core.c>
    Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
    Order Allow,Deny
    Allow

    from all
    </IfModule>
    </FilesMatch>

    IndexIgnore */*


    ## NOTE: If you want even greater security to prevent hackers from running scripts in this folder, uncomment the following line (if your

    hosting company will allow you to use OPTIONS):
    # OPTIONS -Indexes -ExecCGI



    ##################
    ## Optional caching improvements
    ## Requires mod_headers to be enabled within Apache
    ##################
    <IfModule mod_headers.c>
    Header unset Pragma
    FileETag None
    Header unset ETag
    <FilesMatch "(?i).*\.(jpe?g|gif|webp|png|swf)$">
    Header set Cache-control "max-

    age=864000, public, must-revalidate"
    Header unset Last-Modified
    </FilesMatch>
    </IfModule>
    So, I don't see the capitalized version of the file extension. Would suggest editing (for JPEG/JPG) as to the following in two places:
    Code:
    #
    # @copyright Copyright 2003-2013 Zen Cart Development Team
    # @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    # @version GIT: $Id: Author: DrByte  Fri May 17 14:29:18 2013 -0400 Modified in v1.5.2 $
    #
    # This is used with Apache WebServers
    #
    # The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
    # It also prevents the ability of any scripts to run. No type of script,   be it PHP, PERL or whatever, can normally be executed if ExecCGI is   disabled.
    # Will also prevent people from seeing what is in the dir. and any sub-directories
    #
    # For this to work, you must include either 'All' or at least: 'Limit'   and 'Indexes' parameters to the AllowOverride configuration in your  apache/conf/httpd.conf file.
    # Additionally, if you want the added protection offered by the OPTIONS   directive below, you'll need to add 'Options' to the AllowOverride  list,  if 'All' is not specified.
    # Example:
    #<Directory "/usr/local/apache/htdocs">
    #  AllowOverride Limit Options Indexes
    #</Directory>
    ###############################
    
    # deny *everything*
    <FilesMatch ".*">
      
    
    <IfModule mod_authz_core.c>
        Require all denied
      </IfModule>
      <IfModule !mod_authz_core.c>
        Order Allow,Deny
        Deny from all
      </IfModule>
    </FilesMatch>
    
    # but now allow just *certain* necessary files:
    <FilesMatch "(?i).*\.(jpe?g|JPE?G|gif|webp|png|swf)$" >
    
      <IfModule mod_authz_core.c>
        Require all granted
      </IfModule>
      <IfModule !mod_authz_core.c>
        Order Allow,Deny
        Allow from all
      </IfModule>
    </FilesMatch>
    
    IndexIgnore */*
    
    
    ## NOTE: If you want even greater security to prevent hackers from   running scripts in this folder, uncomment the following line (if your  hosting company will allow you to use OPTIONS):
    # OPTIONS -Indexes -ExecCGI
    
    
    
    ##################
    ## Optional caching improvements
    ## Requires mod_headers to be enabled within Apache
    ##################
    <IfModule mod_headers.c>
      Header unset Pragma
      FileETag None
      Header unset ETag
      <FilesMatch "(?i).*\.(jpe?g|JPE?G|gif|webp|png|swf)$">
         Header set Cache-control "max-age=864000, public, must-revalidate"
        Header unset Last-Modified
      </FilesMatch>
    </IfModule>
    The file's permissions may not support saving the change(s) made which could be why the previous/described edits made do not appear in the attached content. Typically the file's attributes/permissions would need to be at least 0644 or possibly 0666 to support writing the change(s).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Jul 2012
    Posts
    16,748
    Plugin Contributions
    17

    Default Re: Uppercase JPG image files 403 Forbidden

    Quote Originally Posted by lat9 View Post
    Not true. The change to IH-5 disallows the mixture of .jpg and .JPG files for a product.
    Sorry, that was not so clearly understood from the discussion.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,595
    Plugin Contributions
    88

    Default Re: Uppercase JPG image files 403 Forbidden

    Isn't the (?i) in the FilesMatch directive indicating that the match is to be case-insensitive?

  10. #10
    Join Date
    Aug 2012
    Location
    Kitty Hawk, NC
    Posts
    55
    Plugin Contributions
    0

    Default Re: Uppercase JPG image files 403 Forbidden

    Ah ha! I didn't change the permissions first. Thank you for your help, it is greatly appreciated!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 Polipay 403 Forbidden
    By mikecnz in forum Addon Payment Modules
    Replies: 4
    Last Post: 22 Jun 2021, 12:54 AM
  2. 403 Forbidden Error
    By billett in forum General Questions
    Replies: 2
    Last Post: 11 May 2010, 08:14 PM
  3. 403 forbidden
    By sublime19 in forum General Questions
    Replies: 1
    Last Post: 17 Aug 2008, 09:43 PM
  4. SSL 403 Forbidden
    By brokensaber in forum Basic Configuration
    Replies: 0
    Last Post: 5 Feb 2008, 02:52 AM

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