From 643bb873e1f2e01271a74f867b6219fb3574cf6c Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Wed, 8 Jan 2025 13:29:47 +1100 Subject: [PATCH] Fixed exclusion of Acquia apex domains for non-www -> www redirect in `.htaccess`. --- .vortex/tests/bats/_helper.bash | 4 ++-- web/.htaccess | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.vortex/tests/bats/_helper.bash b/.vortex/tests/bats/_helper.bash index 4e7b42171..45502d67e 100644 --- a/.vortex/tests/bats/_helper.bash +++ b/.vortex/tests/bats/_helper.bash @@ -845,7 +845,7 @@ assert_files_present_integration_acquia() { assert_symlink_not_exists "hooks/prod/post-db-copy" assert_file_exists "${webroot}/sites/default/includes/providers/settings.acquia.php" - assert_file_contains "${webroot}/.htaccess" "RewriteCond %{ENV:AH_SITE_ENVIRONMENT} prod [NC]" + assert_file_contains "${webroot}/.htaccess" "RewriteCond %{HTTP_HOST} !\.acquia-sites\.com [NC]" if [ "${include_scripts:-}" -eq 1 ]; then assert_dir_exists "scripts" @@ -867,7 +867,7 @@ assert_files_present_no_integration_acquia() { assert_dir_not_exists "hooks" assert_dir_not_exists "hooks/library" assert_file_not_exists "${webroot}sites/default/includes/providers/settings.acquia.php" - assert_file_not_contains "${webroot}/.htaccess" "RewriteCond %{ENV:AH_SITE_ENVIRONMENT} prod [NC]" + assert_file_not_contains "${webroot}/.htaccess" "RewriteCond %{HTTP_HOST} !\.acquia-sites\.com [NC]" assert_file_not_contains ".env" "VORTEX_ACQUIA_APP_NAME=" assert_file_not_contains ".env" "VORTEX_DB_DOWNLOAD_ACQUIA_DB_NAME=" assert_file_not_contains ".ahoy.yml" "VORTEX_ACQUIA_APP_NAME=" diff --git a/web/.htaccess b/web/.htaccess index 8ec7a8939..8aded2767 100644 --- a/web/.htaccess +++ b/web/.htaccess @@ -106,7 +106,7 @@ AddEncoding gzip svgz # Redirect all non-ww requests to www. RewriteCond %{HTTP_HOST} . #;< ACQUIA - RewriteCond %{ENV:AH_SITE_ENVIRONMENT} prod [NC] # only Production environment. + RewriteCond %{HTTP_HOST} !\.acquia-sites\.com [NC] #;> ACQUIA RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]