How to transfer a WordPress blog to a different domain?

I recommend handling the 301 redirect in your web server rather than in WordPress. mod_rewrite or RedirectMatch will be much more efficient than spinning up WordPress to deliver a Location: header. <VirtualHost *:80> ServerName busted-cheap-url.com # mod_alias RedirectMatch permanent (.*) http://great-new-url.com$1 # OR mod_rewrite RewriteEngine on RewriteRule (.*) http://great-new-url.com$1 [R=301] </VirtualHost> There are several methods … Read more

Installation problems on a domain-name-less server

Set server_name to the IP address, eg: server { listen 80; server_name 0.1.2.3; // other stuff } You could also leave it out, because the default in ngninx is an empty string. But then all those pieces in WordPress that don’t validate $_SERVER[‘SERVER_NAME’] and similar values … will just break. See ticket #25239 for the … Read more

multisite: use a virtual subfolder for subblogs

I had a similar issue with another client, entering something like projects/project1 would error as the / would fail validation. After failing to find an override or filter, instead I found a loophole. If you make projectsproject1, then afterwards edit the site so its url is projects/project1 and save, update the homeurl etc, it works! … Read more

How to limit user registration to a specific set of domains?

You can do it easily by writing a code inside your theme’s functions.php file. here is the code: function is_valid_email_domain($login, $email, $errors ){ $valid_email_domains = array(“gmail.com”,”yahoo.com”);// whitelist email domain lists $valid = false; foreach( $valid_email_domains as $d ){ $d_length = strlen( $d ); $current_email_domain = strtolower( substr( $email, -($d_length), $d_length)); if( $current_email_domain == strtolower($d) ){ … Read more

Mapping Domains to Permalinks (not multisite)

If you set domain.com as an alias of original.com, in WordPress you have to do nothing to make it works. The problem is the countrary: once in DNS the 2 domains are aliases, every url of your WordPress will be accessible via user defined domains: domain.com/any/wp/url, but also domain2.com/any/wp/url, domain3.com/any/wp/url and so on… So, what … Read more

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 BE IDENTICAL for both sites: define(‘COOKIE_DOMAIN’, ‘.domain.com’); // your main domain define(‘COOKIEPATH’, “https://wordpress.stackexchange.com/”); define(‘COOKIEHASH’, md5(‘domain.com’)); // notice absence of a ‘.’ in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)