Closed karpikpl closed 1 year ago
@ZubaeyrMSFT - seems to be some URL redirection configuration setup, look into this issue on priority.
@karpikpl
Please note that a Multisite WordPress can be associated and accessed with only one domain. You have used an AFD endpoint for installing the multisite (wordpressp-xxx.azurefd.net). And therefore, the WP is configured with it, and all the embedded links would point to it.
Few questions I wanted to understand. Are you looking for a subdomain-based multisite or subdirectory-based multisite? I see that you have installed subdirectory multisite and trying to access it like a subdomain one?
Please follow the instructions here: How to enable multisite WordPress on App Service and also refer to the Important Notes section in there.
These are the steps for converting a new single site to multisite (assuming AFD is already integrated with App Service and necessary app settings are added as mentioned here)
Map all the required custom domains to the AFD endpoint. customdomain.org, site1.customdomain.org, site2.customdomain.org etc.,
Add the following App Settings to install subdomain based multisite. This will only work if multisite isn't installed already. CUSTOM_DOMAIN - customdomain.org WORDPRESS_MULTISITE_TYPE - subdomain WORDPRESS_MULTISITE_CONVERT - true
Add the following App Setting to install subdirectory based multisite. This will only work if multisite isn't installed already. CUSTOM_DOMAIN - customdomain.org WORDPRESS_MULTISITE_TYPE - subdirectory WORDPRESS_MULTISITE_CONVERT - true
If you want to update your current multisite to point to custom domain. You can try manual steps mentioned below.
I was trying to have a mix of multi-site and multi-domain.
I think that's what author of #84 did. Having wordpress configured with multi-site directory but AFD configured with multiple domains, e.g:
myfirstdomain.com -> wordpressp-xxx.azurefd.net/site1 myseconddomain.com -> wordpressp-xxx.azurefd.net/site2
but from what you're saying that's not possible - one wordpress instance == one domain? Only sub-domains can be used?
Yes, you are right. Multisite supports only one main domain at a time. May I know if there are any reasons for using the mixed approach? And why not just use subdomain based multisite? It's better go with purely subdomain-based multisite in this case.
Thanks for all the answers and support! I was trying to follow this - https://www.wpbeginner.com/wp-tutorials/how-to-create-a-wordpress-multisite-with-different-domains/ where different domains were possible.
I thought with AFD I can hide paths or set headers to make it work...
I went with subdomain route.
I verified with /phpmyadmin
that all values are correct.
I checked that FD is setting custom host header on the route -> the subdomain one site3.wp.xxx.org
. It was also added to app service as custom domain.
It doesn't work for me though - I cannot view the site (it shows the main one on wp.xxx.org) and I was getting CORS errors, so I've added subdomains to my App Service settings.
Still getting errors though:
Uncaught DOMException: Failed to execute 'replaceState' on 'History': A history state object with URL 'https://wp.xxx.org/wp-admin/post-new.php' cannot be created in a document with origin 'https://site3.wp.xxx.org' and URL 'https://site3.wp.xxx.org/wp-admin/post-new.php'.
the subdomain part worked after adding this to wp-config.php
/** overriding HTTP_HOST header */
if (!empty(getenv('AFD_DOMAIN'))) {
$_SERVER['HTTP_HOST'] = getenv('AFD_DOMAIN');
}
if (array_key_exists('HTTP_X_FORWARDED_HOST', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_HOST'])){
$_SERVER['HTTP_HOST']=$_SERVER['HTTP_X_FORWARDED_HOST'];
}
Hi, I've configured a multi-site wordpress instance with Front Door.
Front Door has 3 routes that proxy traffic to the app service:
wordpressp-xxx.azurefd.net
-> wordpress app origin groupsite1.customdomain.org
-> wordpress app origin group with Origin Path/site1
site2.customdomain.org
-> wordpress app origin group with Origin Path/site2
My network admin -> sites configuration looks like this:
wordpressp-xxx.azurefd.net/site1
for site1wordpressp-xxx.azurefd.net/site2
for site2wordpressp-xxx.azurefd.net
for mainThe sites look OK when initially opened. The custom domain is used and
site1
path is correctly added by FrontDoor. The problem is that all the links are absolute and usewordpressp-xxx.azurefd.net
instead of custom domain.I tried changing site configuration:
Site Address (URL)
siteurl
home
but nothing worked so far.What's the correct setup for this custom domain -> multi-site deployment?