Giter Club home page Giter Club logo

domains's Introduction

Domains

Domains for WordPress Multisite.

Requires WordPress 4.5+. Specifically meant for using domains on subdirectory Multisite installs.

Note: This plugin does not replace all existing URLs in the database. Therefore, it is recommended to install this immediately after creating a multisite install.

Installation

If you're using Composer to manage WordPress, add this plugin to your project's dependencies. Run:

composer require trendwerk/domains

Setup

The basic setup of this plugin consists of two steps:

  1. Define the correct constants in your WordPress configuration file (default: wp-config.php)
  2. Configure the .domains file, which is the main configuration file for this plugin

Constants

define('SUNRISE', true);

This activates a WordPress drop-in plugin called sunrise.php. Allows this plugin to perform actions right before Multisite is loaded.

define('CONTENT_DIR', '/app');

This is only necessary if your content folder is not located in the default /wp-content folder. The example above uses /app.

define('DOMAIN_CURRENT_SITE', 'www.example.com');

Probably not necessary to say, but this should be defined when using Multisite. This plugin relies on it being defined as well.

Omit these constants

Never define the following constants when using Multisite and this plugin:

  • WP_CONTENT_URL - should be defined by this plugin
  • WP_HOME - not used by Multisite
  • WP_SITEURL - not used by Multisite

Configuration

The .domains file is the main configuration file for this plugin and contains all domains. It is set up in the format blogId:domain. Domain aliases can be created by separating domains by a comma. For example:

2=www.example.com,example.com
3=www.example.org

The domains file should be located in the root of your project. This file should probably be excluded from version control, since enviroments are usually run on different domains. When using Capistrano for deployment, it should be defined as a linked file.

Note: This plugin searches for the .domains file in the folder where WordPress is located and a maximum of two folders up.

domains's People

Contributors

haroldangenent avatar

Watchers

Paul Barthmaier 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.