Forums / Templates, Stylesheets, Page Layout / My .htaccess files are restricting access to my images

My .htaccess files are restricting access to my images

Started by elly on 23 May 2011, 11:09 AM · Views: 1,114

Results 1 to 9 of 9
23 May 2011, 11:09 AM
#1
elly avatar

elly

New Zenner

Join Date:
May 2011
Posts:
49
Plugin Contributions:
0

My .htaccess files are restricting access to my images

What do the .htaccess files do and why do I need them?

I have found what the problem was with loading the open source templates on my Zen Cart, and also trying to load a custom template.

I took people's advice and went to my host provider. After much to'ing and fro'ing, they came up with this solution:-

It looks like the .htaccess files are restricting access to the images, I have renamed the files in the /includes and /templates directory to .bak-htaccess for now, and this appears to let the images load, for example:: http://www.ellybooks.co.uk/shop/includes/templates/classic/images/scr_template_default.jpg now loads fine in the browser.<<

Now that these files are, effectively inactive, it may cause problems down the line I am not aware of. Any thoughts?

The previous issues I was having are detailed on yesterday's "adding a logo/header" thread

23 May 2011, 3:07 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: My .htaccess files are restricting access to my images

The .htaccess files provided with Zen Cart will not prevent access to common image files if you're using contemporary versions of Apache/PHP. If you're using some other webserver engine that's not capable of handling the advanced security protections offered by the supplied .htaccess files, then you'll need to delete/rename those .htaccess files and work with your hosting company to come up with another way to handle the security protections based on your server's unique configuration/requirements. Until you do that, you leave your site open to risk of abuse.

Also note that if you used your hosting control panel to enable a "hotlink protection" feature, that might have added something to your .htaccess files which broke the image handling you've mentioned. That's up to you and your hosting company to sort out, and is not a Zen Cart issue.

.
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.

23 May 2011, 5:30 PM
#3
elly avatar

elly

New Zenner

Join Date:
May 2011
Posts:
49
Plugin Contributions:
0

Re: My .htaccess files are restricting access to my images

Thanks Dr Byte, I'll go back to them again.

24 May 2011, 8:41 AM
#4
elly avatar

elly

New Zenner

Join Date:
May 2011
Posts:
49
Plugin Contributions:
0

Re: My .htaccess files are restricting access to my images

This is what my host said:-

I have narrowed the issue down to the security in the /public_html/shop/includes/templates/.htaccess file, however I have been unable to get this to work within the current server environment, the server does run Apache and its capable of running these .htaccess. We can assist to a certain degree, but we cannot offer support on third party scripting installations im afraid. <<

Now I am totally stuck.

And totally miserable.

24 May 2011, 9:46 AM
#5
elly avatar

elly

New Zenner

Join Date:
May 2011
Posts:
49
Plugin Contributions:
0

Re: My .htaccess files are restricting access to my images

I have decided to try another shopping cart in the hope it won't clash with my webhost.

This is not a reflection on Zen Cart, which I think is a great piece of software, but on my **** host. If I hadn't just paid for a year's hosting with them - and if I expected to make more than pin money on my site - I would be dropping them and paying to go somewhere else.

Thank you for the support of the people on these forums. You've been really helpful and generous in giving your time.

24 May 2011, 9:58 AM
#6
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: My .htaccess files are restricting access to my images

/public_html/shop/includes/templates/.htaccess file << this file your problem

There is no such file in a default Zen Cart. Not sure where that particular '.htaccess' file came from but you are safe to delete it.

The learning is in the doing.

Potent Products

24 May 2011, 10:01 AM
#7
elly avatar

elly

New Zenner

Join Date:
May 2011
Posts:
49
Plugin Contributions:
0

Re: My .htaccess files are restricting access to my images

Website Rob:

/public_html/shop/includes/templates/.htaccess file << this file your problem

There is no such file in a default Zen Cart. Not sure where that particular '.htaccess' file came from but you are safe to delete it.

Rob - you could just be my saviour! Many thanks.

I'm having a bit of a week of it - and it's only Tuesday! :shocking:

24 May 2011, 10:08 AM
#8
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: My .htaccess files are restricting access to my images

Something else you need to do.

Admin > Tools > Layout Boxes Controller

Click the 'reset' button at page bottom.

That will fix the problem you are having with your Template look.

The learning is in the doing.

Potent Products

24 May 2011, 10:25 AM
#9
elly avatar

elly

New Zenner

Join Date:
May 2011
Posts:
49
Plugin Contributions:
0

Re: My .htaccess files are restricting access to my images

Website Rob:

Something else you need to do.

Admin > Tools > Layout Boxes Controller

Click the 'reset' button at page bottom.

That will fix the problem you are having with your Template look.

Hi Rob - yep, I did that.