Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I don't think testimonials would have enticed me to become a member, or even use the site for that matter. I use the site for a learning experience..."

Geography

Where in the world do Tek-Tips members come from?

htaccess -> deny access to wildcard subdirectories without using rewriterule

K9logic (Programmer)
16 Jun 12 1:36

Is it possible to deny access to a subdirectory from a htaccess file in the root?

The exact structure is like this:

/root/.htaccess
/root/subdirs/sub1/noaccess
/root/subdirs/sub1/access
/root/subdirs/sub2/noaccess
/root/subdirs/sub2/access


the .htaccess on the root should disable access to the 2 "noaccess" directories.
something like: /subdirs/(.*)/noaccess -> deny all

i dont think i can use a rewrite rule because each "noaccess" directory contains a htaccess with rewrite rules already. (mainly this one: RewriteRule ^(.*)$ index.php [NC,L])


Possible?

Thank you
Thomas




site | http://thomassmart.com / http://thomassmart.hk
blog | http://weblog.thomassmart.com

RhythmAce (TechnicalUser)
17 Jun 12 10:38
One of the easiest ways is to put a .htaccess file in any subdir where you do not want access. It allows you to specify which type of access/authentication that subdirectory and all its subs can have. You can put just about any directive in the file that you can put in apache's main config file. You can also have as many .htaccess files as you want.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close