Skip to content

Instantly share code, notes, and snippets.

@anavdesign
Last active October 27, 2022 16:20
Show Gist options
  • Save anavdesign/387849c78da2e736aace3ddbd4cbca2f to your computer and use it in GitHub Desktop.
Save anavdesign/387849c78da2e736aace3ddbd4cbca2f to your computer and use it in GitHub Desktop.
Drupal: General Settings

Drupal General

Force SSL

  1. Open /.htaccess file.

  2. Find:

    RewriteEngine on
    
  3. And add this code snipped below it:

      # Redirect to HTTPS
      RewriteCond %{HTTPS} off
      RewriteCond %{HTTP:X-Forwarded-Proto} !https
      RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    

Folder and File Permissions

sudo find web/ -type d -exec chmod 755 {} \;
sudo find web/ -type f -exec chmod 644 {} \;
sudo chmod 444 web/.htaccess;
sudo chmod 555 web/sites/default/;
sudo chmod 744 web/sites/default/settings.php;
sudo find web/sites/default/files -type d -exec chmod 775 {} \;
sudo find web/sites/default/files -type f -exec chmod 644 {} \;

Increase PHP Memory

Append to .htacecss file in drupal root directory

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value memory_limit 64M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment