Jump to content
xisto Community

Recommended Posts

hi, i want to restrict certain files to be directly accessed in certain directories . These files are supposed to be included in other pages , but i want to restrict people just copy pasting their url's / copy shortcuts and paste them on the browser . is this possible by using .htaccess or something else ? I am on a shared hosting account of course and don't have root access . I would like to redirect the users / or simply restrict access to the file directly .

Share this post


Link to post
Share on other sites

CPanel>Hotlink Protection>EnableInput the addresses that the files can be viewed from. Just keep defult settings.I think this only works on images, Yes-I think?If you add another sub-domain, Stop it, Refresh, Start it again.That new sub-domain is not included if you add it after you enable it.

Share this post


Link to post
Share on other sites

Q. How can I make a directory not list certain files?
A. You'll need to add the following to your .htaccess file:

IndexIgnore *.gif *.jpg

To disallow Directory browsing all together, add this to your .htaccess file:

Options -indexes

To show files in a slightly more beautiful fashion:

Options +Indexes
IndexOptions FancyIndexing

Taken from this site. It doesn't specify, but the first command is only hides JPGs and GIFs. You can hide any kind of file, and if you want to hide specific files, just replace the "*.gif" and "*.jpg" with the file names.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.