Multi Levels .htacess files

Joined
Apr 4, 2019
Messages
42
Reaction score
10
How do you go about blocking crawling and indexation from htaccess files when you several folder structures on a staging site ?

Example: domain.com/demo/demo-1/client-site

Both domain.com folder and client-site have their own htaccess files with different rules.

Which set of rules is overwriting which one?

I haven’t been able to find any information online about « multi-levels » htaccess. Any information or resource is welcome.
 
Please post demo code. It's tough to say anything without the actual code and your folder structure (just use some dummy folder name if security is your concern).
 
I should have explained a bit clearer what am trying to achieve here.

I wish to set rules to block crawling and indexation for any files on that domain once and for all without having to change htaccess at a sub folder level, when creating a new demo site.

Am guessing that I should apply rules at domain.com levels that overwrites the rules at domain.com/demo/demo-1/client-site-name/

domain.com folder level is empty apart from basic files u get from a Wordpress install.

I build demo sites at /client-site-name/ level.

so whenever I get a new instance created for a new site, the htaccess file at this level has nothing to prevent indexation.

I recently faced issue post live as some demo site pages were indexed...
 
Back
Top