Im having a problem getting my secondary level .htaccess to work correctly. Maybe one of you gents can figure this one out.
My structure is /home/public_html/skins
In /home/public_html directory I have my primary .htaccess file which contains (among other things), this:
<IfModule mod_expires.c><br />
<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico)$"><br />
ExpiresActive On<br />
ExpiresDefault "access plus 10 years"<br />
</FilesMatch><br />
</IfModule><br />
<br />
<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico)$"><br />
FileETag none<br />
</FilesMatch><br />
<br />
<IfModule mod_geoip.c><br />
SetEnvIf GEOIP_COUNTRY_CODE (RU|CN|KR) DenyCountry<br />
SetEnvIf GEOIP_CONTINENT_CODE (AF) DenyContinent<br />
</IfModule><br />
<br />
<Files *><br />
Order Allow,Deny<br />
Allow from 127.0.0.1<br />
Allow from All<br />
Deny from env=DenyCountry<br />
Deny from env=DenyContinent<br />
</Files>
```<br />
<br />
In my /home/public_html/skins directoy, my .htaccess looks like this:<br />
<br />
```php
<Files ~ "\.(php|tpl)$"><br />
Order Allow,Deny<br />
Deny from all<br />
</Files><br />
Allow from all<br />
Options -Indexes
```<br />
<br />
Is there anything that stands out as to explain why the 2nd level .htaccess file isnt working? What I mean is, it is not blocking .php and .tpl files as it should be.
Thanks for the reply. The .htaccess in the skins folder is unmodified (except for the “Order Allow,Deny” line). I thought perhaps it was a precedence issue so I added that line, however that did not seem to fix it.
Like I said though, thats the default .htaccess from cs-cart so I assume thats not the problem.
[quote name=‘tbirnseth’]Try
Order Allow,Deny
Allow from all
Options -Indexes
Deny from all
I think it’s a precedence issue. I.e. you’re telling it to deny for php/tpl but then saying allow all.
my advice would be to re-upload the default htaccess files from the cs-cart ZIP file. that worked for me (i am a mac user and something went wrong when i uploaded after decompressing the zip file instead of uploading direct from the zip). if that makes any sense ;p