Trusted Business Software and Services Since 2010 Trusted Business Software and Services Since 2010
  • Resources
    • Fastest WordPress Hosting
    • WordPress Tips
    • WordPress Plugin Boilerplate
    • Zoho Partner
    • Digital Business Cards
  • Portfolio
  • Contact Us
    • Marketing Spend Calculator
  • Free Online Small
    Business Marketing Report
  • Blog
  • Join Cliff’s Email List

WP Engine Staging Site’s Own wp-config.php Rules

By Clifford P on August 16, 2013

Here’s something everyone should add to their wp-config.php file if hosted with WP Engine:

How it Works

WP Engine loads up everyone’s wp-config.php files for their own wrangling — for optimization, SSL settings, and even hard-coding domains.

Part of the Copy from Production to Staging process is regenerating the wp-config.php with your staging site’s domain as the DOMAIN_CURRENT_SITE value. Here’s what the differences look like:

Production wp-config.php contains this:

define(‘DOMAIN_CURRENT_SITE’, ‘www.example.com’);

Staging wp-config.php contains this:

define(‘DOMAIN_CURRENT_SITE’,’example.staging.wpengine.com’);

So the code above says “if DOMAIN_CURRENT_SITE ends in .staging.wpengine.com, do …”

That’s why the code NEEDS to be placed below WP Engine’s initial defining of DOMAIN_CURRENT_SITE.

Basically, just scroll all the way to the bottom and place this code just before the “# That’s It. Pencils down” line.

WP Engine wp-config-php Conditionals

Get Creative

Of course, you could invert the logic and have rules just for Production instead of or in addition to just for Staging.

An alternative method that may be preferred by some can be found at Paulund: Multi-Environment WordPress wp-config.php.

Now that you know how to have separate rules for WP Engine Production vs. WP Engine Staging, you might be looking for some more sweet wp-config.php hacks.

Not Yet Hosting with WP Engine? Just do it.

Click the image below to get started.

WP Engine HostingAffiliate link

Posted in Advice/Tips/How-To.
PreviousAt Least 5 Ways to Embed Gists in WordPress
NextLastPass Free or Paid + LastPass Alternatives 2022
  • For your review: our Policies and Contact Information

    Copyright © 2010–2023 · Log in

    Made with by Clifford Paulick

  • Trustworthy, Long-Term Software and Business Services Since 2010
  • Free Online Small Business Marketing Report
  • Resources
    • WordPress Tips
    • WordPress Plugin Boilerplate
    • Zoho Partner
    • Digital Business Cards
  • Contact Us
    • Marketing Spend Calculator
  • Blog
  • Join Cliff’s Email List
  • Resources
    • Fastest WordPress Hosting
    • WordPress Tips
    • WordPress Plugin Boilerplate
    • Zoho Partner
    • Digital Business Cards
  • Portfolio
  • Contact Us
    • Marketing Spend Calculator
  • Free Online Small
    Business Marketing Report
  • Blog
  • Join Cliff’s Email List