Use one main wp-config.php
and name the others according to the name of the host:
- example.com.config.php
- example.net.config.php
- and so on.
In your main wp-config.php
write:
$current_config = __DIR__ . "https://wordpress.stackexchange.com/" . $_SERVER['HTTP_HOST'] . '.config.php';
if ( file_exists( $current_config ) )
require_once $current_config;
Related Posts:
- Best practice for versioning wp-config.php?
- Moving a WP Multisite to a subdirectory
- Password in wp-config. Dangerous?
- What’s the difference between WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT?
- Turn Off Automatic Trash Deletion?
- What is the best way to get directory path for wp-config.php?
- Move WordPress to subdirectory, keep ALL URLs
- How can I change preview URL?
- How to individually set WP_DEBUG on a sub-directory multisite?
- Override the wp_siteurl and wp_home not work
- Missing a temporary folder despite settings in wp-config.php
- How to use live images on local install?
- Permalink Issues by Installing WordPress in Subdirectory / Subfolder
- Syntax of FS_CHMOD_DIR and FS_CHMOD_FILE
- Declaratively Configuring WordPress in XML or JSON or YAML
- WP_MEMORY_LIMIT didn’t work in wp-config
- Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes)
- How to set up gmail SMTP in WordPress
- error:-Cannot modify header information – headers already sent by
- Changing HTTP URL Port
- wp-config.php file permissions
- How to update WordPress from the latest trunk
- how to use is_admin in wp-config.php
- Locked out of WordPress Site Admin after enabling Force SSL on WordPress Https (SSL)
- Set wp-content folder to Dropbox folder
- Including a 3rd party library in WordPress which needs to be accessible by wp-config
- register_theme_directory somehow “fails” when folder is outside of WP-Folder
- Installation Issue WordPress locally – The file ‘wp-config.php’ already exists
- What is this file: wp-config-wpe.php?
- html lang=”” instead of lang=”en-us” – why?
- Custom theme folder
- Why do I get a WAMP homepage when clicking on specific website’s URL on LocalHost?
- What Does this Code Snippet Do?
- WP_Debug not displaying anything
- Can I delete `wp-config-sample.php` after installing and configuring WordPress?
- How to reliably set file/folder permissions?
- Why edits to wp-config.php must come before “That’s all” comment
- WP install in sub-dir white screen
- Is it possible to override the ABSPATH constant
- How to stop fatal error when loading theme template file directly
- WordPress (behind HAProxy and Jetty), not multisite, in sub folder – and /en/wp-admin/ keeps redirecting to /wp-admin/
- Should I change wp-config for SSL?
- Out of memory errors : how best to track them down
- Redefine cookie domain for subdomains
- multiple language directories
- Error in database connection [closed]
- Update wp-config.php and lost pages
- Conflict with wp_homeurl, wp_siteurl and admin interface settings
- error messages in dashboard login
- where should I write constants in wordpress?
- Issues copying site into local machine
- Autosave interval remains default despite wp-config.php defines
- Carriage Return control character (^M) found in wp-config-sample.php
- Need help fixing my wp-config file [closed]
- Why was my new WordPress installation’s config page publicly viewable when first installed?
- WP_MEMORY_LIMIT didn’t work in wp-config, only within default-constants.php
- Cookie set without HttpOnly flag
- Define option outside wp-config.php (on WordPress.com)
- Site lost all formatting when I attempted to migrate to Bluehost [closed]
- Moving wp-config.php one level up – 500 error – Nginx [closed]
- How can I configure an SMTP Server?
- What should index.php contain on Synology NAS to get external access to WordPress to work?
- Remote server does not read `WP_HOME` from wp-config.php when local server does
- IP addresses to block to stop WP auto-update?
- Concerns over wp-config file [closed]
- Not showing old migrated content in website
- How to rename the wp-config.php file once under version control?
- Read wp-config without loading the rest of WordPress – i.e. wp-settings, etc
- Proper way to have multiple installs with a single database
- How turn on error reporting without reset?
- WordPress installed on a Sub-directory
- Editing wp-config.php file asks for another installation
- Conditional config WP_HOME/WP_SITEURL does not update bloginfo(‘template_url’)?
- $post->id vs $post->ID problem after using WordPress config bootstrap
- How to stage a redesigned site on a new webhost while the original site is still live? [closed]
- WordPress login redirection not working on Nginx root directory
- Need help re-connecting local WP-config file to local database
- Change of “home” results in timeouts (only on index.php)
- wp-config.php randomly will reset to wp-config-sample.php
- WP_SITEURL vs WP_HOME link output
- How to fix wp-login.php gives error 500 after migration?
- Change default wordpress FS owner
- Define new constants in wp-config
- sudden changing of host IP result in crash of the site
- Move wp-content outside root
- Can you define readability settings in wp-config.php?
- Can wp-config move cause dashboard not to load?
- Resource 404 error on multisite subdirectory install
- Unable to change WordPress language (WordPress 4.2.2)
- How to change WordPress theme file path to a remote server?
- FTPS Uploads – wp-content cannot be found
- WordPress Redirect on Name Change
- .htaccess and virtual host configuration for WP in its own directory
- Best function/method to access wp-config?
- WordPress still requires FTP information
- “Cannot modify header information” warning?
- Change URL when visiting wordpress site
- max_input_vars not updating through wp-config
- Can WP-CLI modify database connection details in existing wp-config file?
- How to specify server path in code?