PDA

View Full Version : Disallow access to directory through the web?



darkchicken101
04-01-2008, 12:39 AM
I want to put some js files in a folder where they cannot be accessed by navigating to them through a web browser, but still be able to link them into my webpages. I don't know if this is possible, but I think I'll need to use .htaccess somehow.

Thanks

Florx
04-01-2008, 12:42 AM
If you have cPanel click "Password protect Directories" then it will do it for you.

EDIT: Reread the post - try hotlink protection :)

PM me for more help if you need it :)

Good luck.

Ini
04-01-2008, 12:42 AM
Hmm.. Just make loads of folders..

Like a maze..

Florx
04-01-2008, 12:45 AM
Hmm.. Just make loads of folders..

Like a maze..
Pointless because you can look in the source then see the path straight away :p

Ini
04-01-2008, 01:14 AM
Pointless because you can look in the source then see the path straight away :p
Oh well

darkchicken101
04-01-2008, 01:23 AM
People looking in the source is what I was trying to protect against. All they should be able to see is a <script> tag linking to a file they can't see.

I tried

order deny,allow
deny from all
allow from 127.0.0.1

in .htaccess but it didn't let the html file access the javascript file, but it blocked users from accessing the file.

darkchicken101
05-01-2008, 12:15 AM
I thought about using PHP includes but they would work would they?

Want to hide these adverts? Register an account for free!