-
Notifications
You must be signed in to change notification settings - Fork 60
Description
I'm having trouble with getting the .htaccess correct when using multi-config in a subdirectory. Here's my directory set up:
/config
/config_site2
/public_html
-.htaccess
-/site2
--.htaccess
/system
/system_site2
I have two multi-config files in two directories above the root (/config and /config_site2) along with two system folders (/system and /sytem_site2).
In the /public_html folder, I have the subdirectory (/public_html/site2) that's correctly rendering site2.
I'm consistently getting 500 server error, however. Here's the .htaccess file for site2:
#------------------- remove trailing slash -------------------
RewriteCond %{REQUEST_URI} !^/system_site2 [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)/$ /$1$2 [R=301,L,QSA]
#------------------- index.php -------------------
#strip index.php from the URL if that is all that is given
RewriteCond %{REQUEST_URI} !^/site2/system_site2
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)index.php\ HTTP/
RewriteRule ^(([^/]+/))index.php$ https://%{HTTP_HOST}/site2/ [R=301,NS,L,QSA]
#strip index.php/* from the URL
RewriteCond %{THE_REQUEST} ^[^/]/site2/index.php/ [NC]
RewriteRule ^index.php/(.+) https://%{HTTP_HOST}/$1$2 [R=301,L,QSA]
#------------------- CE Cache Static Driver -------------------
RewriteCond %{REQUEST_URI} !^/system_site2 [NC]
RewriteCond %{QUERY_STRING} !ACT|URL [NC]
RewriteCond %{REQUEST_METHOD} !=POST [NC]
RewriteCond %{DOCUMENT_ROOT}/static/ce_cache/190328/static%{REQUEST_URI}/index.html -f
RewriteRule (.) /_static_cache_handler.php%{REQUEST_URI}/index.html [L,QSA]
#------------------- EE -------------------
#rewrite all non-image/js/css urls back to index.php if they are not files or directories
RewriteCond $1 !.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /site2/index.php/$1 [L,QSA]
What am I overlooking? Thanks much in advance!