Jump to content

[SOLVED] Blocking Folder Access from all but Internal requests?


Guest

Recommended Posts

Hello all,

 

I've been searching for a definitive way to do this, and I've found things that beat around the bush, but never quite did what I wanted.

 

I want to block direct access to a folder and all its sub directories, but allow access for internal requests; like when a page loads external stylesheets or images.

 

And this has to be in an .htaccess file--so the Directory directive won't work.

 

I've tried exploring the principle for preventing hotlinking (checking the referrer), but I haven't actually tried it, and would also like to know if there are any other options.

 

Any help is appreciated. Thanks in advance!

Link to comment
Share on other sites

Bah, forgive me. Minutes after I posted this, I remembered I could have done an 402 redirect with rewriterule. And on top of that, I should have put this into the mod_Rewrite category!

 

Sorry for the trouble!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.