Last active
November 10, 2015 08:37
-
-
Save benjamin-dk/8d121f5dbd30da959af5 to your computer and use it in GitHub Desktop.
Fix default Drupal .htaccess settings to comply with new Apache (2.4) standards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Searches the current working directory recursively and replaces old symlink-setting with the new | |
read -p "This script should be run from the Drupal root folder to work properly. Is this our current location?" -n 1 -r | |
echo # (optional) move to a new line | |
if [[ ! $REPLY =~ ^[Yy]$ ]] | |
then | |
exit 1 | |
fi | |
curdir=$(pwd) | |
filetofix="${curdir}/.htaccess" | |
if [ -e "$filetofix" ] | |
then | |
echo "$filetofix exists." | |
find ${curdir} -name .htaccess -exec sed -i 's/FollowSymLinks/SymLinksIfOwnerMatch/g' {} \; | |
fi | |
echo "Replacing FollowSymLinks with SymLinksIfOwnerMatch in the following .htaccess files:" | |
find . -name .htaccess |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment