Block Directory using .htaccess
-
- New to forums
- Posts: 7
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Fri Mar 07, 2014 5:05 pm
Block Directory using .htaccess
I did manage to do this before, but then the user could not see any CSS styling as it blocked the user from seeing any CSS. I am trying to figure out how I can block asset directories such as /css, /img, /js, ect. Anyone know of a way of doing this with a .htaccess or another method that results in a 403 error?
Re: Block Directory using .htaccess
There are a few ways you could do this, but the easiest would be to create a blank index.html file and place it in that directory.
If you wanted to strictly due this with .htaccess, adding "deny from all" should be all you need.
If you wanted to strictly due this with .htaccess, adding "deny from all" should be all you need.
@Kraze^NFo> Juski has a very valid point
@Juski> Got my new signature, thanks!
@Kraze^NFo> Out of context!
@Juski> Doesn't matter!
@Juski> You said I had a valid point! You can't take it back now! It's out there!
@Juski> Got my new signature, thanks!
@Kraze^NFo> Out of context!
@Juski> Doesn't matter!
@Juski> You said I had a valid point! You can't take it back now! It's out there!
Re: Block Directory using .htaccess
That works, but then I cannot see any styling at all. The user cannot see the CSS on the page so all the styles are gone.
Re: Block Directory using .htaccess
You may try switching it out for "Options All -Indexes".
@Kraze^NFo> Juski has a very valid point
@Juski> Got my new signature, thanks!
@Kraze^NFo> Out of context!
@Juski> Doesn't matter!
@Juski> You said I had a valid point! You can't take it back now! It's out there!
@Juski> Got my new signature, thanks!
@Kraze^NFo> Out of context!
@Juski> Doesn't matter!
@Juski> You said I had a valid point! You can't take it back now! It's out there!
Re: Block Directory using .htaccess
That worked magically. Thanks for your help.