-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwp-config.php
More file actions
104 lines (94 loc) · 3.81 KB
/
wp-config.php
File metadata and controls
104 lines (94 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
/**
* Project-wide configuration file for Git-Optimized WordPress
*
* @package Git-Optimized WordPress
* @version 1.1
* @author Ian MacKenzie
* @link https://github.com/quayzar/git-optimized-wordpress
*
* This file contains all project-wide configurations for a Git-optimized WordPress site.
* It is (and should remain) part of the project repository. This file looks for a localized
* config file (containing all sensitive, environment-specific configurations) in the web
* root or one level above.
*/
/* Define absolute path to the WordPress subdirectory */
if ( !defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}
/* Define path options for localized config files */
define( 'WEB_ROOT', dirname( ABSPATH ) . '/' );
define( 'ABOVE_WEB_ROOT', dirname( WEB_ROOT ) . '/' );
/* Find and require localized config file */
$config_file = 'config.php';
if ( file_exists( WEB_ROOT . $config_file ) || file_exists( ABOVE_WEB_ROOT . $config_file ) ) { // found it
require file_exists( WEB_ROOT . $config_file ) ? WEB_ROOT . $config_file : ABOVE_WEB_ROOT . $config_file;
} else { // didn't find it so stop
die ( "<h1 style='font-weight:bold;font-family:sans-serif;color:#F00;'>No localized config file found!</h1>" );
}
/*
* Default salts & keys
* These will be used if none are defined in the localized config file loaded above
* Generate them here: https://api.wordpress.org/secret-key/1.1/salt/
*
* IMPORTANT: REPLACE THE PLACEHOLDER TEXT HERE WITH PROPERLY-GENERATED VALUES!
*
*/
if ( !defined( 'AUTH_KEY' ) ) {
define( 'AUTH_KEY', 'replace_this_with_a_unique_phrase' );
}
if ( !defined( 'SECURE_AUTH_KEY' ) ) {
define( 'SECURE_AUTH_KEY', 'replace_this_with_a_unique_phrase' );
}
if ( !defined( 'LOGGED_IN_KEY' ) ) {
define( 'LOGGED_IN_KEY', 'replace_this_with_a_unique_phrase' );
}
if ( !defined( 'NONCE_KEY' ) ) {
define( 'NONCE_KEY', 'replace_this_with_a_unique_phrase' );
}
if ( !defined( 'AUTH_SALT' ) ) {
define( 'AUTH_SALT', 'replace_this_with_a_unique_phrase' );
}
if ( !defined( 'SECURE_AUTH_SALT' ) ) {
define( 'SECURE_AUTH_SALT', 'replace_this_with_a_unique_phrase' );
}
if ( !defined( 'LOGGED_IN_SALT' ) ) {
define( 'LOGGED_IN_SALT', 'replace_this_with_a_unique_phrase' );
}
if ( !defined( 'NONCE_SALT' ) ) {
define( 'NONCE_SALT', 'replace_this_with_a_unique_phrase' );
}
/* Confirm all salts & keys have been updated */
if (
'replace_this_with_a_unique_phrase' == AUTH_KEY ||
'replace_this_with_a_unique_phrase' == SECURE_AUTH_KEY ||
'replace_this_with_a_unique_phrase' == LOGGED_IN_KEY ||
'replace_this_with_a_unique_phrase' == NONCE_KEY ||
'replace_this_with_a_unique_phrase' == AUTH_SALT ||
'replace_this_with_a_unique_phrase' == SECURE_AUTH_SALT ||
'replace_this_with_a_unique_phrase' == LOGGED_IN_SALT ||
'replace_this_with_a_unique_phrase' == NONCE_SALT
) {
die ( "<h1 style='font-weight:bold;font-family:sans-serif;color:#F00;'>Replace placeholder text in /wp-config.php with properly-generated salts & keys!</h1>" );
}
/* Define site paths */
if ( !defined( 'ADDL_SUBDIR' ) ) {
define( 'ADDL_SUBDIR', '' );
}
/* Enforce SSL if enabled */
if( defined( 'SSL_ENABLED' ) && SSL_ENABLED ) {
define( 'FORCE_SSL_ADMIN', true );
}
/* Define WordPress paths */
define( 'WP_HOME', ( ( defined( 'SSL_ENABLED' ) && SSL_ENABLED ) ? 'https' : 'http' ) . '://' . $_SERVER['SERVER_NAME'] . ADDL_SUBDIR );
define( 'WP_CONTENT_DIR', WEB_ROOT . 'wp-content' );
define( 'WP_SITEURL', WP_HOME . '/cms' );
define( 'WP_CONTENT_URL', WP_HOME . '/wp-content' );
/* Disable file editing */
define( 'DISALLOW_FILE_EDIT', true );
/* Define common database settings */
define( 'DB_CHARSET', 'utf8' );
define( 'DB_COLLATE', '' );
$table_prefix = 'wp_';
/* Load WordPress */
require_once( ABSPATH . 'wp-settings.php' );