Symptoms
When accessing a subdirectory for a site or a subdomain in a browser, the parent directory .htaccess RewriteRule directives are applied.
Description
.htaccess directives are recursive. This means the RewriteRule directive in a .htaccess file can affect all subdirectories within the directory the .htaccess file exists in. For example, if a RewriteRule directive is added to /home/cpaneluser/public_html/.htaccess, the RewriteRule directive can also affect /home/cpaneluser/public_html/subdirectory/.htaccess when not configured correctly.
Workaround
Adjust the .htaccess RewriteRule or RewriteCond directives in the parent directory .htaccess file so that directives are not applied to subdirectories or subdomains. As an example, the following can be used to prevent a RewriteRule from affecting a specific subdirectory:
RewriteCond %{REQUEST_URI} !^/subdirectory/ [NC]
Comments
0 comments
Article is closed for comments.