Article Image
read

Here is what I wanted to do: index.html should be the only file visible. Every folder or files should be hidden using .htaccess. That's all.

It's something easy in fact, here's the instruction to redirect any visitor coming from somewhere else than you index (deep link / folders / sub-folders / files...):

RewriteEngine on
RewriteRule !^wp($|/) http://mywebsite.com%{REQUEST_URI} [L,R=301]

But, I need to access a specific folder. Instead of creating exceptions in your very first .htaccess file located in the root folder, use another one to send new instructions. So here's the deal, put this .htaccess in your folder, it'll be visible and you'll not be redirected:

RewriteEngine off
Blog Logo

Florent Bertiaux

I'm a blogger


Published

Image

I learned something new

A blog from @kxrz - Dev tips and tricks

Back to Overview