Skip to content

Commit

Permalink
Fix .htaccess-lando not being read when present.
Browse files Browse the repository at this point in the history
Apache looks for `.htaccess` files in the order listed in `AccessFileName`,
reading only the first one it finds. Lando is supposed to change that
list, but it isn't working. See:
https://github.com/lando/lando/issues/2277
This project needs the updated `AccessFileName` list so the `.htaccess`
file on the server can include Shibboleth statements that will cause
errors in Lando, while the local, Lando-specific file, excludes them.
  • Loading branch information
Andrew Wilson committed Aug 19, 2021
1 parent df2b34b commit 92c97ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ config:

services:
appserver:
build_as_root:
- .lando/fix-htaccess-file.sh
build:
- git submodule init
- git submodule update
Expand Down
10 changes: 10 additions & 0 deletions .lando/fix-htaccess-file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#/bin/sh

# This loads an alternate htaccess file, `.htaccess-lando` if it is present.
# The change is supposed to be made by core lando, but is failing. See:
# https://github.com/lando/lando/issues/2277

echo "Checking for AccessFileName in /etc/apache2/apache2.conf..."
if [ -e /etc/apache2/apache2.conf ]; then
sed -i 's/AccessFileName .htaccess/AccessFileName .htaccess-lando .htaccess/g' /etc/apache2/apache2.conf
fi

0 comments on commit 92c97ca

Please sign in to comment.