1
I have a file HTACCESS
at the root of my project. However, I have a subfolder that also has a file HTACCESS
. But I’m not sure how to make this code override part of the HTACCESS
root.
HTACCESS root:
...
RewriteEngine On
#RewriteCond %{HTTP_HOST} !^www.
#RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^(css|js|img)/(.*)$ statics/$1/$2 [L]
...
HTACCESS subfolder:
RewriteEngine On
RewriteRule ^(css|js|img)/(.*)$ test/statics/$1/$2 [L]
What is the directory structure? By default htaccess will overwrite the rules in the folder and subfolders it is in, but it does not affect the level above it
– Costamilam
by e:. i have an htaccess at the root and another inside a folder that is at the root. at the root I have an index.php and inside this folder q is at the root I have another index.php.
– alan
And what is the name of the subfolder? It is
test
?– Costamilam
No. But it might be. Pq tb changed the name to "Rewriterule (css|js|img)/(.*)$ test/statics/$1/$2 [L]". Just for the example. In real instead of test is the name of the folder.
– alan