Sử dụng Wildcard domain cho NHIỀU SITE wordpress Cấu hình trên xampp hiện tại là:
Sử dụng Wildcard domain cho NHIỀU SITE wordpress Cấu hình trên xampp hiện tại là:
ServerName wp1.com ServerAlias *.wp1.com
DocumentRoot "C:/xampp82/htdocs/s1wp1"
SSLEngine on SSLCertificateFile "conf/mwp1/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/mwp1/ssl.key/server.key"
AllowOverride All
Require all granted
TÔi muốn nó chạy wp1.com và sub1.wp1.com và sub2.wp1.com tôi phải cấu hình như nào cho đúng. Tôi đang sử dụng xapp trên windowsVà đã cấu hình thành công
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the installation.
* You don't have to use the website, you can copy this file to "wp-config.php"
* and fill in the values.
*
* This file contains the following configurations:
*
* * Database settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/
*
* @package WordPress
*/
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wp1' );
/** Database username */
define( 'DB_USER', 'root' );
/** Database password */
define( 'DB_PASSWORD', '' );
/** Database hostname */
define( 'DB_HOST', 'localhost' );
/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );
/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/**#@+
* Authentication unique keys and salts.
*
* Change these to different unique phrases! You can generate these using
* the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
*
* 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.
*
* @since 2.6.0
*/
define( 'AUTH_KEY', '!b>mMQ90aj-pu0.:3k:6d}),^*!A!Q[@qB:Dboci +mG]a:=c(BIZ{B/0OFd(`J=' );
define( 'SECURE_AUTH_KEY', 'Y2yho<.qJz`+:%!al+JG=s`vd=uH5,8i|f>#@.xI_,;< Vr[>dah_:Jk@?{Lvw]!' );
define( 'LOGGED_IN_KEY', '*opK(8 ZDVK5^EVMiTGy$@5K6>>0`&u0j4JbTFJYx`7D)gg-3/zo^>I!^HGy)R}=' );
define( 'NONCE_KEY', '4*U0[s$#ot8U0] s^6n7(M-MnLv.sI`j$cF3^GZ1PWZn[tUrvf~&gTV*{hOl8EPU' );
define( 'AUTH_SALT', '6^<m$~{QDVAU*cn4/sC#B4;cMa{EUpN4W.9GNVJA+W_A|lC)I/`.4;xM>jHKOKw#' );
define( 'SECURE_AUTH_SALT', '3K^4%x_}#ob5zB.^^>0~R{y>$,%Xkyd{a>k#(|Ax.]d-:BJ3Iu-KHk>@xt}r:l7a' );
define( 'LOGGED_IN_SALT', 'IA;@LY%o2a:Z+{J{jsD@_2xtkh,37Hl4eO0,NIl8v6aXy+`5_(OpPo)3.tFfz}CA' );
define( 'NONCE_SALT', 'YtvbrnrY9pS9z`_nJ~u#K8Q0 _ZaQ3!X$q90O<-fNPN].aGV-PhH4}(J/*]U1z6X' );
/**#@-*/
/**
* WordPress database table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*
* At the installation time, database tables are created with the specified prefix.
* Changing this value after WordPress is installed will make your site think
* it has not been installed.
*
* @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/#table-prefix
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the documentation.
*
* @link https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/
*/
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
define( 'DOMAIN_CURRENT_SITE', 'wp1.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
// define( 'WP_DEBUG', true );
// define( 'WP_DEBUG_DISPLAY', true );
// @ini_set( 'display_errors', 1 );
/* Add any custom values between this line and the "stop editing" line. */
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';Các bước kiểm tra và hoàn thiện để nó chạy đúng
Nếu bạn muốn NHIỀU SITE WORDPRESS RIÊNG BIỆT (không phải Multisite)
PreviousMẹo hướng dẫn cấu hình SSL trên localhost cho XAMPP full có cả xác thực ssl, https (ok)NextInstall OpenSSL on Windows (ok)
Last updated