Forbid to access domain/images folder?
#1
Posted 04 November 2009, 02:46
Try this store:
http://www.homedecorr.com/images/
All images are accessible
But in this store:
http://www.ponyvillages.com/images/
showed: Forbidden
You don't have permission to access /images/ on this server.
------------------------------------------------------------
Apache/2.0.52 (CentOS) Server at www.ponyvillages.com Port 80
I tried to change the file permissions to 766 or 744 in cpanel, it did not work, it made all images invisible in the main page.
#2
Posted 04 November 2009, 02:52
snowrabbit, on 04 November 2009, 02:46, said:
Try this store:
http://www.homedecorr.com/images/
All images are accessible
But in this store:
http://www.ponyvillages.com/images/
showed: Forbidden
You don't have permission to access /images/ on this server.
------------------------------------------------------------
Apache/2.0.52 (CentOS) Server at www.ponyvillages.com Port 80
I tried to change the file permissions to 766 or 744 in cpanel, it did not work, it made all images invisible in the main page.
I prefer redirection.
In the /images folder make an index.php file and put this content in it:
<?php
header ("Location: http://www.YOURDOMAIN.com/index.php");
?>
Just change the redirect location to suit your needs.
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#3
Posted 04 November 2009, 03:29
I don't know much about php, could you please input a little detail? what is redirection?
#4
Posted 04 November 2009, 03:31
snowrabbit, on 04 November 2009, 03:29, said:
I don't know much about php, could you please input a little detail? what is redirection?
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#5
Posted 04 November 2009, 03:37
what i got after adding a index.php was:
Fatal error: Call to undefined function phpheader() in.............on line 1
How can I get the wording above like:
Forbidden
You don't have permission to access /images/ on this server.
#6
Posted 04 November 2009, 03:40
snowrabbit, on 04 November 2009, 03:37, said:
what i got after adding a index.php was:
Fatal error: Call to undefined function phpheader() in.............on line 1
How can I get the wording above like:
Forbidden
You don't have permission to access /images/ on this server.
Three lines of code.
If you copy/paste from the forum it may have "run together" on one line.
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#7
Posted 04 November 2009, 03:56
I found a lots of stores come up with the wording "Forbidden.........." don't know how.
Anyway, your way also make my images folder un-accessible. That is great!
Thank you so much!
#8
Posted 05 January 2010, 19:39
germ, on 04 November 2009, 02:52, said:
I prefer redirection.
In the /images folder make an index.php file and put this content in it:
<?php
header ("Location: http://www.YOURDOMAIN.com/index.php");
?>
Just change the redirect location to suit your needs.Hi, and thanks for the information. I appreciate all the wonderful information and helpers in these forums. My question is if I make this folder or make and index.html that says they are forbidden or what ever, will this stop the hackers if the chmod is set to 777 so I can upload images from admin?
I have my chmod set to 755 on images. I did the instant chat with my ISP and sent a line from another post that said it was something they had to take care of - Well they fixed it so I could upload pictures from admin I was happy until I checked cPanel and they had set the chmod to 777. That was their cure so I am looking again. I was hacked about mid Dec like all the others and I think I have that bit taken care of with the cures and fixes from else where in the forums. Only problem left to resolve (I think) is uploading pictures in admin.
Thanks much for your help.
Lou
Edited by crasales, 05 January 2010, 19:47.
cra-sales.com
#9
Posted 05 January 2010, 23:52
germ, on 04 November 2009, 02:52, said:
Options -Indexes
#10
Posted 07 January 2010, 00:26
It doesn't stop hackers from uploading files into a folder with 777 permissions, but it does stop them from RUNNING the hack code.
Hack code that can't be ran is just another harmless text file.
I tried it and I do know for a fact it prevents PHP files from running.
If you can't/don't want to switch hosts and go to one where the images folder wouldn't have to be 777 in order to use osC this could be a viable alternative.
There is also a contribution called "osC Filebrowser" you could consider installing (I did).
With it you would use FTP (or some other means) to upload images, and osC Filebrowser let's you choose them from your /catalog/images in your admin when adding products/categories in lieu of uploading from your PC in the admin.
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >














