37 votes
Accepted

Cookies in Multisite network where sites have their own domain name?

First clear your browser's cache (including cookies), and your server's cache (e.g. cache plugins). Then set the following in your wp-config.php file: define('ADMIN_COOKIE_PATH', '/'); define('...
Scott's user avatar
  • 1,315
9 votes

Cookies in Multisite network where sites have their own domain name?

Using WordPress version 4.9.4. I was getting the cookie error and looked through various help options and eventually solved it by using a parts of Scott's fix. (Note: I didn't do any cookie cache ...
user140609's user avatar
7 votes

How to share cookies and sessions between domain and subdomain?

I'll skip steps related to sharing DB and sharing users data and meta, based on assumption that you've done it correctly. Let's concentrate on wp-config.php of both sites. These are defines that MUST ...
Frank P. Walentynowicz's user avatar
7 votes
Accepted

Blog posts on one subdomain, pages on another

I might have a solution for you. First steps: Within your domain's DNS manager you need to create a CNAME record. The name would be blog and the hostname would be your domain name. This is ...
filipecsweb's user avatar
  • 1,005
5 votes
Accepted

Htaccess for Wordpess set on single subdomain

My suggestion is: use the same standard .htaccess configuration for Wordpress on a single domain in each Wordpress directory. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ...
Fayaz's user avatar
  • 8,909
5 votes

Multisite: differences between subdomain and subdirectory mode? Can it be switch after installation?

From a user perspective there are two noticeable differences. First of all the GUI for creating new sites. Either it shows an input field for the first segment of the URL path (subdirectory) or an ...
David's user avatar
  • 3,277
4 votes
Accepted

Wordpress subdomain wp-admin redirects to main domain

Based on Charles Clarkson's comment, I directly changed the siteurl and home options in the wp_options table to be https://dev.example.com/ and this fixed the problem for me.
Meekohi's user avatar
  • 155
4 votes
Accepted

Problem with loading images from child theme CSS file with relevant path

There's no need for the wp-content/themes path - both themes sit in the same directory, so you can just traverse up one and then back down to child theme: background-image: url(../child-theme-name/...
TheDeadMedic's user avatar
  • 36.4k
4 votes

Cookies in Multisite network where sites have their own domain name?

Finally after hours, literally, of troubleshooting I was able to get this resolved on the AWS Lightsail Bitnami Multisite Wordpress (WordPress 5.0.4) instance by performing the following: Ensure the ...
George Drew's user avatar
3 votes

Hosting a Wordpress blog as a sub folder from a S3 website

You are using Cloudfront in front of S3, so in order to mix in 2 sources of content you need to on your blog.mycompany.com - add rewrites of blog/* -> /* so that your blog can handle blog.mycompany....
WowPress.host's user avatar
3 votes
Accepted

Non-wordpress subdomains on Multisite Installation

The WP Codex gives two examples of excluding a subdirectory from multisite's control. .htaccess method (as Karthik noted) Virtual host method .htaccess Being sure to call the sub rewrite BEFORE the ...
hwl's user avatar
  • 2,115
3 votes
Accepted

Login on Multiple Sub-Domains without Multisite

You can dynamically update the WP_HOME and WP_SITEURL constants in wp-config.php to reflect the requested host: define( 'WP_SITEURL', 'http://' . $_SERVER[ 'HTTP_HOST' ] ); define( 'WP_HOME', 'http://...
bosco's user avatar
  • 6,805
3 votes

Transfer Subdomain site to Multisite setup

Assuming sd1.mysite.com and sd2.mysite.com are single WordPress installs. You can create mysite.com as a WordPress Multisite, you can then export the posts, users, etc and reimport to the new ...
Liam Stewart's user avatar
3 votes
Accepted

WP Multisite - domain mapping to domain.com and separate site to domain.com/help

Yes, this is possible (see https://wordpress.org/support/article/create-a-network/). For sub-domains you'll need to confirm that your DNS has a wildcard entry for your domain. So, based on your root ...
deronimo's user avatar
  • 166
3 votes
Accepted

How do I use different domain for subdomains in WP Multisite?

Let's establish the baseline: it is possible to have the main site in example-domain-x.com and all subsites subdomains in example-domain-y.com. You just add subdomain1.example-domain-y.com (or ...
Celso Bessa's user avatar
  • 1,108
2 votes
Accepted

How would you detect if WordPress is installed in a subdirectory (not root)?

You need to check if the siteurl differs from the home URL: if ( get_option( 'siteurl' ) !== get_option( 'home' ) ) { // whatever This also works if home is a subdirectory of the root, with ...
fischi's user avatar
  • 7,499
2 votes

Logout via Subdomain, non-wordpress page on a different server?

Assuming you are the administrator of both sites... Add admin ajax handler in your main wp site... add_action( 'wp_ajax_logout', 'my_logout_callback' ); function my_logout_callback() { wp_logout(...
shramee's user avatar
  • 477
2 votes
Accepted

Wordpress CDN Subdomain URL not accessible to the public

To prevent folder listing you could add an .htaccess file to the root of your subdomain with this content: Options -Indexes
rémy's user avatar
  • 149
2 votes

Two instances of WordPress with different URLs and themes

As of clarification via comment, you really don't need a additional version, subdomain with the same content. What you need is to get the post content, nothing more. The styling and such should happen ...
Nicolai Grossherr's user avatar
2 votes
Accepted

WordPress Multisite/Network - How to use a subdomain as main blog and subdomain for child sites

There's a couple of different ways that might work, but both rely on using Apache/NGINX directives. Method 1 Setup WordPress MS at mydomain.com, create an admin.mydomain.com site and then redirect ...
fergbrain's user avatar
  • 450
2 votes
Accepted

How to add a custom redirect rule for subdomains?

It's better not to use these sort of subdomain redirect rules within WordPress: WordPress may not load properly when you access it using the wrong domain name or sub-domain, as a typical WordPress ...
Fayaz's user avatar
  • 8,909
2 votes

Cookies in Multisite network where sites have their own domain name?

I just finished troubleshooting a similar issue with subdomain multisite. With: define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']); The site was still throwing a cookie error and in some instances of ...
Ruben Apolinar's user avatar
2 votes

How to redirect the frontend of a WordPress site (only)?

Use below rule, RewriteEngine On # excluding www RewriteCond %{HTTP_HOST} !^www RewriteCond %{HTTP_HOST} ^blog # excluding wp-admin RewriteCond %{REQUEST_URI} !^wp-admin RewriteRule ^ https://www....
Abhishek Gurjar's user avatar
2 votes
Accepted

wp_get_attachment_image_src on multisite

wp_get_attachment_image_src() function returns an array that's why your code isn't working. Try the following code. <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"> <...
obiPlabon's user avatar
  • 1,719
2 votes

When creating a multisite, the sub-folders option is not available

From the Codex article Before You Create A Network: You cannot choose Sub-directory Install (for a path-based network) if your existing WordPress installation has been set up for more than a month, ...
Pat J's user avatar
  • 11.8k
2 votes
Accepted

Installing wordpress on a subdomain of an already existing static website

NO.. By static i think you mean a standard (simple) HTML site. wordpress cannot be installed on a subdomain of an already exisiting static website, because there might be some code confilcts. ...
Bjorn's user avatar
  • 535
2 votes

Transfer Subdomain site to Multisite setup

I had pretty good experiences using WP-CLI and the WP-CLI plugin MU-Migration. You most certainly have to install the latter, depending on your environment the former too, consult the documentation on ...
Nicolai Grossherr's user avatar
2 votes

Transfer Subdomain site to Multisite setup

There were two articles about how to migrate Single WP sites into MultiSite and Migrate Subdomains into MultiSite, which helped me much. The whole point is that if you are not going to use migrator ...
T.Todua's user avatar
  • 5,789
2 votes
Accepted

Is it possible to install WordPress Multisite on a subdomain with subdirectories?

Yes, it is. All you need to do is to install your WordPress on the subdomain, turn the Multisite on and set it to use subdirectories for sites. Make sure the following is set in multisite constants: ...
Krzysiek Dróżdż's user avatar
2 votes

How to retrieve TLD domain for the current website?

The $_SERVER['HTTP_HOST'] global will usually contain the domain/subdomain to which the current request was sent, but with a few caveats. In the context of a web request, the variable is set at the ...
bosco's user avatar
  • 6,805

Only top scored, non community-wiki answers of a minimum length are eligible