Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude directory from htaccess

I want to create a restricted area on a subdirectory, but there is some conflict with the htaccess auto generated from WorPdress on home page and so I got a redirect on 404 error page when I try to access on this subdirectory

I tried to exclude it from .htaccess on home page with:

RewriteCond %{REQUEST_URI}  !(folder1|folder2|folder3) [NC]

but nothing. How can I solve it? Thank you!

like image 536
Fabrizio Antani Avatar asked Feb 28 '26 15:02

Fabrizio Antani


1 Answers

You should modify WP htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} !^/folder1/$
RewriteCond %{REQUEST_URI} !^/folder2/$
RewriteCond %{REQUEST_URI} !^/folder3/$

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
like image 133
ITChristian Avatar answered Mar 03 '26 09:03

ITChristian