Forum Moderators: phranque

Message Too Old, No Replies

Quick help please

Quick help please

         

lokeshshetty

10:49 pm on Dec 16, 2007 (gmt 0)

10+ Year Member



Hi,
I am all new to php, starting from today, got a free host that uses php mysql. now when i type in the url, say, [mysite.com...] it takes me to my index.php
however when i type in the url, say, [mysite.com...] (a folder) it displays all the images inside it.

Can someone please help me with this. All i want is when someone types in the url, like the one above they all should be redirected to an error page. my idea is to have them navigate thru links only on the website

any help on this is highly appreciated

Jon_King

11:21 pm on Dec 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



CPanel?

Go to Index Manager...

The index manager will allow you to turn indexes on or off for a directory. If indexes are off, people will not be able to see what files are in a directory that lacks an index file.

lokeshshetty

9:40 am on Dec 17, 2007 (gmt 0)

10+ Year Member



hey Jon

It works wonders, thanks much
one more question, when someone tries to access a folder contents, now they get a 'Forbidden' message. Is it possible for me to redirect them to an error page of my own?

Cheers

wilderness

11:31 am on Dec 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



They get a 403-Forbidden because neither an index (html¦php) exists.

A simple solution is to just create an index page with a brief explantion that contents of this directory are not directly accessible.

Jon_King

3:59 pm on Dec 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Either what wilderness said, or in Cpanel you should find Error Pages options. You can set custom pages for:

400 (Bad request)
401 (Authorization required)
403 (Forbidden)
404 (Wrong page)
500 (Internal server error)

Added:
lokeshshetty Welcome to Webmaster World!

[edited by: Jon_King at 4:03 pm (utc) on Dec. 17, 2007]

lokeshshetty

8:02 pm on Dec 17, 2007 (gmt 0)

10+ Year Member



Thanks a ton guys, that helped bigtime

Cheers