osCommerce Community Support Forums: Forbid to access domain/images folder? - osCommerce Community Support Forums

Jump to content

Corporate Sponsor


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Forbid to access domain/images folder? Rate Topic: -----

#1 User is offline   snowrabbit Icon

  • Find Posts
  • Group: Community Member
  • Posts: 25
  • Joined: 04-November 09
  • Real Name:snowrabbit

Posted 04 November 2009 - 02:46 AM

Does anybody know how to forbid accessing domain/images folder?

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

#2 User is offline   germ Icon

  • Find Posts
  • Group: Community Member
  • Posts: 9,597
  • Joined: 10-April 07
  • Real Name:Jim
  • Gender:Male
  • Location:USA - C.S.T.

Posted 04 November 2009 - 02:52 AM

View Postsnowrabbit, on 03 November 2009 - 09:46 PM, said:

Does anybody know how to forbid accessing domain/images folder?

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.

You can "forbid" it with a .htaccess command (I think).

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.
If I suggest that you edit any file(s) make a backup first - I'm not perfect and neither are you.

I only post what the voices in my head tell me to.


$sample_it = ( ($this->has_Flavor() ) ? $mmm->mmm('good') : $want->do_Not() );
0

#3 User is offline   snowrabbit Icon

  • Find Posts
  • Group: Community Member
  • Posts: 25
  • Joined: 04-November 09
  • Real Name:snowrabbit

Posted 04 November 2009 - 03:29 AM

Really appreciate!

I don't know much about php, could you please input a little detail? what is redirection?
0

#4 User is offline   germ Icon

  • Find Posts
  • Group: Community Member
  • Posts: 9,597
  • Joined: 10-April 07
  • Real Name:Jim
  • Gender:Male
  • Location:USA - C.S.T.

Posted 04 November 2009 - 03:31 AM

View Postsnowrabbit, on 03 November 2009 - 10:29 PM, said:

Really appreciate!

I don't know much about php, could you please input a little detail? what is redirection?

Making the viewers browser go to a different page.
If I suggest that you edit any file(s) make a backup first - I'm not perfect and neither are you.

I only post what the voices in my head tell me to.


$sample_it = ( ($this->has_Flavor() ) ? $mmm->mmm('good') : $want->do_Not() );
0

#5 User is offline   snowrabbit Icon

  • Find Posts
  • Group: Community Member
  • Posts: 25
  • Joined: 04-November 09
  • Real Name:snowrabbit

Posted 04 November 2009 - 03:37 AM

Thank you!

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

#6 User is offline   germ Icon

  • Find Posts
  • Group: Community Member
  • Posts: 9,597
  • Joined: 10-April 07
  • Real Name:Jim
  • Gender:Male
  • Location:USA - C.S.T.

Posted 04 November 2009 - 03:40 AM

View Postsnowrabbit, on 03 November 2009 - 10:37 PM, said:

Thank you!

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.

Make sure the code appears just as I posted it.

Three lines of code.

If you copy/paste from the forum it may have "run together" on one line.
If I suggest that you edit any file(s) make a backup first - I'm not perfect and neither are you.

I only post what the voices in my head tell me to.


$sample_it = ( ($this->has_Flavor() ) ? $mmm->mmm('good') : $want->do_Not() );
0

#7 User is offline   snowrabbit Icon

  • Find Posts
  • Group: Community Member
  • Posts: 25
  • Joined: 04-November 09
  • Real Name:snowrabbit

Posted 04 November 2009 - 03:56 AM

I understand what the php means now, it will go to my main page when browsing domain/images. isn't?



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!
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic