Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 05-21-2009, 03:11 AM   #1
Silver Member
 
Join Date: May 2009
Posts: 107
Default How to deny access to a folder

How can I avoid this in every directory without an index.html file?

http://www.shakeandbake247.com/images/

To David and Mark, of Shake and bake, I hope you dont mind me using this example. You did post your site here looking for help.
wachtn is offline   Reply With Quote


Old 05-21-2009, 08:24 AM   #2
Gold Member
 
orangecopper's Avatar
 
Join Date: May 2009
Location: India
Posts: 334
Default

Hey..Go to your FTP client, Browse to this folder and change the CHMOD ( permissions ) for the folder to no Read access to public. then on opening in browser it would give error: not authorized to access.

The link: http://www.javascriptkit.com/script/...chmodcal.shtml
Shows different values u can use for chmod.


regards
Joshu
orangecopper is offline   Reply With Quote
Old 05-21-2009, 09:36 AM   #3
Silver Member
 
Join Date: May 2009
Posts: 107
Default

Thank you.
I dont have any web design training. Just got the software needed and have been slowing learning how to use it.

Can you suggest the proper values to use? I have played around with CHMOD already but I wound up denying access to everything within the directory not just to that only level of my site.

example:
If I changed the permission to for the directory www.site-root.com/image_folder/ every image, site wide, that was stored in that directory was blocked.
wachtn is offline   Reply With Quote
Old 05-23-2009, 08:06 PM   #4
New Member
 
Join Date: May 2009
Posts: 3
Post use a javascript redirect code

A very simple way to do this is to create an index.html page in the folder that you want to keep people out of that has a JavaScript re-direct code in it that will redirect to the homepage when the someone types in the url of the folder.

For example, you have www.sitename.com/images. You want to keep someone out of the images folder. With a java script redirect code you can do this easily. It will redirect from www.sitename.com/images to www.sitename.com (your homepage).

The code looks like:

<script type="text/javascript">
<!--
window.location = "http://www.sitename.com/"
//-->
</script>

Paste this in the head section of the index.html page you create in the folder you wish to block, replacing sitename.com with your URL. (Leave the http://, it is needed to find the site.
pjmcdermott is offline   Reply With Quote
Old 05-24-2009, 03:02 AM   #5
Silver Member
 
Join Date: May 2009
Posts: 107
Default

pjm, Great suggestion. Thank you for that code. Putting it someplace safe right now. I have used a similar tech with an index.html that said "click here to return to the home page."

You code is much better tho. Thank you.
wachtn is offline   Reply With Quote


Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:03 AM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.