最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

multisite - How to map domains to specific pages in WordPress and display them in the address bar?

programmeradmin2浏览0评论

I would like to have the following setup but don't quite know how to do it in cPanel or use WordPress MultiSite or both?

www.maindomain.co.uk - with a wordpress install at www.maindomain.co.uk

www.seconddomain.co.uk - to access the webpage www.maindomain.co.uk/page1/ and replace with www.seconddomain.co.uk in the address bar.

www.thirddomain.co.uk - to access the webpage www.maindomain.co.uk/page2/ and replace with www.thirddomain.co.uk in the address bar.

I want to maintain one site with plugins but domains mapped to specific pages and replacing them in the address bar.

How would I set this up?

I would like to have the following setup but don't quite know how to do it in cPanel or use WordPress MultiSite or both?

www.maindomain.co.uk - with a wordpress install at www.maindomain.co.uk

www.seconddomain.co.uk - to access the webpage www.maindomain.co.uk/page1/ and replace with www.seconddomain.co.uk in the address bar.

www.thirddomain.co.uk - to access the webpage www.maindomain.co.uk/page2/ and replace with www.thirddomain.co.uk in the address bar.

I want to maintain one site with plugins but domains mapped to specific pages and replacing them in the address bar.

How would I set this up?

Share Improve this question asked Mar 16, 2020 at 15:16 JenskiJenski 1274 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Create multisite and use sub-domain names in websites rather than directory.

and later Define siteURL in multisite dashboard >> websites >> settings.

.htaccess look like this:

# BEGIN WordPress
RewriteEngine On
RewriteBase /

RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

# avoid error: Request exceeded the limit of 10 internal redirects
RewriteCond %{ENV:REDIRECT_STATUS} 200 [OR]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress

for config.php file

define('ENABLE_CACHE', true);
define('CACHE_EXPIRATION_TIME', 604800);
define('WP_MEMORY_LIMIT', '92M');
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'dev1.domainurl');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define('SUNRISE', 'on');

To enable customizer this will help:

https://wordpress/support/topic/making-customizer-work-with-domain-mapping/

发布评论

评论列表(0)

  1. 暂无评论