· 7 years ago · Jan 26, 2019, 02:18 PM
1http://my-domain.com >> https://www.my-domain.com
2http://www.my-domain.com >> https://www.my-domain.com
3https://my-domain.com >> https://www.my-domain.com
4https://www.my-domain.com >> https://www.my-domain.com
5www.my-domain.com >> https://www.my-domain.com
6my-domain.com >> https://www.my-domain.com
7
8http://sub.my-domain.com >> https://www.my-domain.com
9https://sub.my-domain.com >> https://sub.my-domain.com
10sub.my-domain.com >> https://sub.my-domain.com
11www.sub.my-domain.com >> https://sub.my-domain.com
12
13# Added to mitigate CVE-2017-8295 vulnerability
14UseCanonicalName On
15
16<VirtualHost *:80>
17 ServerAdmin example@networkmanager
18
19 ServerName my-domain.com
20 ServerAlias www.my-domain.com
21 ServerAlias sub.my-domain.com
22
23 DocumentRoot /var/www/html
24
25 <Directory /var/www/html/>
26 Options FollowSymLinks
27 AllowOverride All
28 Require all granted
29 </Directory>
30
31 ErrorLog ${APACHE_LOG_DIR}/error.log
32 CustomLog ${APACHE_LOG_DIR}/access.log combined
33</VirtualHost>
34
35# BEGIN WordPress
36<IfModule mod_rewrite.c>
37RewriteEngine On
38
39### FORCE HTTPS ###
40RewriteCond %{HTTPS} off
41RewriteCond %{HTTP_HOST} !^sub.
42RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
43
44### FORCE HTTP ###
45# RewriteCond %{HTTPS} on
46# RewriteCond %{HTTP_HOST} ^sub.
47# RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
48
49### non-WWW to WWW ###
50RewriteCond %{HTTP_HOST} !^www.
51RewriteCond %{HTTP_HOST} !^devblog.
52RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
53
54RewriteBase /
55RewriteRule ^index.php$ - [L]
56
57# add a trailing slash to /wp-admin
58RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
59
60RewriteCond %{REQUEST_FILENAME} -f [OR]
61RewriteCond %{REQUEST_FILENAME} -d
62RewriteRule ^ - [L]
63RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
64RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
65RewriteRule . index.php [L]
66</IfModule>
67
68# END WordPress
69
70<?php
71/**
72 * The base configuration for WordPress
73 *
74 * The wp-config.php creation script uses this file during the
75 * installation. You don't have to use the web site, you can
76 * copy this file to "wp-config.php" and fill in the values.
77 *
78 * This file contains the following configurations:
79 *
80 * * MySQL settings
81 * * Secret keys
82 * * Database table prefix
83 * * ABSPATH
84 *
85 * @link https://codex.wordpress.org/Editing_wp-config.php
86 *
87 * @package WordPress
88 */
89
90// ** MySQL settings - You can get this info from your web host ** //
91/** The name of the database for WordPress */
92define('DB_NAME', 'wordpress');
93
94/** MySQL database username */
95define('DB_USER', 'wordpress');
96
97/** MySQL database password */
98define('DB_PASSWORD', 'pass');
99
100/** MySQL hostname */
101define('DB_HOST', 'localhost');
102
103/** Database Charset to use in creating database tables. */
104define('DB_CHARSET', 'utf8');
105
106/** The Database Collate type. Don't change this if in doubt. */
107define('DB_COLLATE', '');
108
109define('WP_ALLOW_MULTISITE', true);
110
111/**#@+
112 * Authentication Unique Keys and Salts.
113 *
114 * Change these to different unique phrases!
115 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
116 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
117 *
118 * @since 2.6.0
119 */
120define('AUTH_KEY', 'kJF^jR+Hv:RrhT~9BF-HQk:}=8P(1)!Su*:mym[r,L0X0s#Y36xySgU{BZ|Cp`.t');
121define('SECURE_AUTH_KEY', 'D7]Wu)U@?Ui!rBK8!lpKs3o:K-J*c/P;wvU,I1%e;o0o6+fi>e4;:mj4pu7nVV80');
122define('LOGGED_IN_KEY', 'B> =:*U!MYf5H/KuJ7x$p;-!l?B`avc`LWry?qE-h>6`iQ&mZ)4npxT2Czj]LO s');
123define('NONCE_KEY', 'sU)5W/M!sl^2<iG[U &t%}W=U,W=ob%qh|hPCU>Rd#&h-Kdf;xK5l7 3c&=Of cZ');
124define('AUTH_SALT', 'GV{DxW(:[2<$~|+N(@Y~wG;-~_ku qCAq1g)Vmyw| c B#O_]/(`W*C=[5`J.0rK');
125define('SECURE_AUTH_SALT', 'sYALmC:s=k4]Tv#.?Mk63^<n&v}T3CGm*D&kMR1Ph6nNO*13wA1fnWjc^3vd>orv');
126define('LOGGED_IN_SALT', '05OM Q(k|OH_6mTS!2T[J;EeUv7a-(@gr.)|yE!/2;8B*Zj%.XvH`S`ks%W~^!-<');
127define('NONCE_SALT', '%[bnnm)4|!P$qKHBVNic9:<U2hh b<#:m4#8 &-ZJ-gU^5sxKrpEgH~#z8hL0[*T');
128
129/**#@-*/
130
131/**
132 * WordPress Database Table prefix.
133 *
134 * You can have multiple installations in one database if you give each
135 * a unique prefix. Only numbers, letters, and underscores please!
136 */
137$table_prefix = 'wp_';
138
139/**
140 * For developers: WordPress debugging mode.
141 *
142 * Change this to true to enable the display of notices during development.
143 * It is strongly recommended that plugin and theme developers use WP_DEBUG
144 * in their development environments.
145 *
146 * For information on other constants that can be used for debugging,
147 * visit the Codex.
148 *
149 * @link https://codex.wordpress.org/Debugging_in_WordPress
150 */
151define('WP_DEBUG', false);
152
153define('MULTISITE', true);
154define('SUBDOMAIN_INSTALL', true);
155define('DOMAIN_CURRENT_SITE', 'my-domain.com');
156define('PATH_CURRENT_SITE', '/');
157define('SITE_ID_CURRENT_SITE', 1);
158define('BLOG_ID_CURRENT_SITE', 1);
159//define('WP_HOME','https://my-domain.com');
160//define('WP_SITEURL','https://my-domain.com');
161//define( 'NOBLOGREDIRECT', 'https://www.my-domain.com' );
162
163/* That's all, stop editing! Happy blogging. */
164
165/** Absolute path to the WordPress directory. */
166if ( !defined('ABSPATH') )
167 define('ABSPATH', dirname(__FILE__) . '/');
168
169/** Sets up WordPress vars and included files. */
170require_once(ABSPATH . 'wp-settings.php');