thanks, i have got what you suggested, was just looking for any other additional ways.
Main Topics
Browse All TopicsI made my .htaccess file block all filetypes including php and html, though now I see it was not such a good idea as it now blocks my homepage!
However, I am left with a impossible situation, I suspect there is some exeptions to the rules though I am unable to find exactly what I want to do..
Bascially, I want to block all file access from external sites. So only requests made via my site will be allowed. Much the same way as hotlinking graphics works. However, when I do this with html, php files, it blocks my homepage. Now is there a way to add the homepage as a exception ?
What I did try was placing all my index files into a /menu/ folder, then having my index.php redirect to /menu/index.php which does work with the re-direct, but it still blocks the /menu/index.php from working so it is not seeing the redirect as comming from the same domain.. I would have thought that would have been enough for it to work, but it did not work :(
any other ideas I could try , or is a impossilbe thing in the first place ?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: ahoffmannPosted on 2009-11-04 at 22:56:54ID: 25747260
> .. I want to block all file access from external sites.
general rule: don't publish
Short answer: you can check the Referer HTTP header and allow access only if it matches your site.
Long answer: the Referer is unreliable as it can be set to whatever i/you/everyone likes.
Hence it no protection i.g.. If you want a real protection, make your page protected with username/password and check the session ID for each request if it is allowed to get your resources.