Git Product home page Git Product logo

craft-master's Introduction

Craft Master

A custom, multi-environment setup for Craft CMS.

Multi-environment Config

We've updated Craft to run comfortably in any environment that we send it to. A few changes have to be made to the primary index.php file and to the environment-specfic config and database files, and then you can work on localhost, staging, dev, production, or wherever else you fancy.

  • Moved system folder above web root
  • Added test for environment to /public_html/index.php
  • Define environment variable in index.php
  • Move plugin folder to just above web root for easier access
  • Move template folder to just above web root for easier access
  • Added folders for default environments: local, dev, live
  • Added copies of general.php and db.php in each environment folder
  • Updated /craft/config/general.php to merge in environment specific config settings
  • Updated /craft/config/db.php to merge in environment specific database settings
  • Moved some config overrides to /craft/config/general.php for easier access
  • Added some config overrides to general.php in local and dev environments
    • Increase logged in user session duration to 101 years
    • Set devMode to true

Custom .htaccess

We've added a handful of things to our base .htaccess file. This assumes certain server settings are turned on and may throw errors if they are not. If that sounds like a headache, you may just want to roll with the default .htaccess provided by Craft.

  • Example code to redirect public access to an offline page while updates are being made
  • Example code to password protect a single environment
  • Set proper MIME type for all files
  • Set gzip compression rules
  • Set Expires headers
  • ETag removal
  • Remove www from URL
  • Force SSL when using dashboard
  • Example code to remove trailing slashes from URL
  • Prevent 404 errors for non-existing redirected folders
  • Set UTF-8 encoding
  • Add various security enhancements
  • Example code to setup relative 301 redirects that will work in any environment
  • Remove index.php from the URL

craft-master's People

Contributors

benparizek avatar bransinanderson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.