.htaccess redirect when index

Asked

Viewed 50 times

0

How to redirect user when it tries to access a folder whose in it does not contain the index?

Ex:

www.eu.com/ <-- index OK
www.eu.com/arquivos/ <-- index Of redireciona para página inicial

1 answer

0

I resolved so!

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index\.php !-f
RewriteCond %{REQUEST_FILENAME}/index\.html !-f

RewriteRule (.*) http://%{HTTP_HOST}%/ [L,R=301]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.