Directory problems ...... Help

They have: 1 posts

Joined: Jun 2006

This may sound stupid, but how exactly do I deny access to my directory. My products and sales pages and thank you are all in the same folder, am I stupid? My site looks like "www.example.com/folder1/salespage.html". Well if you delete the text "salespage.html" you can see the directory for folder1, and all of my products in that director and the thank you pages. Can this be easily fixed or will I have to reconfigure my files, if so how. I’m new to webpage design. Remember that I still want people to be able to access my sales pages and thankyou pages and download my products, but not access the directory.
Thanks for your time.
- Mike

He has: 1,380 posts

Joined: Feb 2002

You need to use a .htaccess file (it's the easiest way), but it blocks the whole directory. To do something more complicated, you're going to have to use a language like PHP, ASP, etc.

Check out: http://httpd.apache.org/docs/1.3/howto/htaccess.html

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Or just drop in an index page. It's just like how your site's home page (index.html probably) is loaded without having to type its name in the URL. Going to example.com really loads example.com/index.html.

If your index pages are called index.html, then make a new empty file called index.html in your folder. If you go to example.com/folder1/index.html you should see a blank page. It should load the same blank page if you go to example.com/folder1/. Of course you can also add text to the page if you want.

It's probably the simplest method, and should work on any web server (just change the file name to suit your server's settings). If you want more flexibility than this technique gives, then look into more sophisticated configuration like with a htaccess file or more, as brady.k says.

Smiling

He has: 1,380 posts

Joined: Feb 2002

That works too...but you can call me Kyle. Wink

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.