I have a question. I am trying to set up two domains under one wordpress instance.
For instance, I have a wordpress site on www.site1.com
I have another domain called www.site2.com. Now, I want to run the same wordpress site that is under www.site1.com on www.site2.com
I tried using the wordpress domain mu mapping plugin
http://wordpress.org/plugins/wordpress-mu-domain-mapping/installation/
But it only allows me subdomains or directories of www.site1.com
Can anyone help?
Add
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] );
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] );
to wp-config.php.
If you meant pointing 2 or more domain names to a single wordpress install, answer is yes you can but it won't work. Wordpress is designed only to host one domain name, if you point another domain name to your wordpress, it will return 404. The other way around to do this is redirect your other domain names to your main domain name (i.e. redirect website2.com to website1.com)
If you meant pointing 2 or more domain names to a Wordpress Multi site install, here's an article that will help you setting up domain mapping in your Wordpress multisite: https://rtcamp.com/wordpress-nginx/tutorials/multisite/domain-mappinng/
We need to set WordPress Multisite Network to make it work. I have successfully set my wordpress v4.1 installation to work for multiple sites and multiple domains by following this and this.
Please note that you will have to make sure editing to php files correctly otherwise that will completely crash your site if you make a mistake. Moreover a correct setting of htaccess is also important.
Related
I'm running wordpress bitnami website on an ec2 instance, via a subdomain. I want the site to point to the top domain. I have tried to figure this out technically but no success. i.e. from new.example.com to www.example.com (default-domain)
You need add an A record for the main domain that points to the machine and then configure the domain in wp-config.php:
define('WP_SITEURL', 'http://DOMAIN/');
define('WP_HOME', 'http://DOMAIN/');
Replacing DOMAIN with the actual domain.
I have the following setup:
The primary domain is example.com. I'm not using this site for any other purpose than managing the other (sub)sites. All the core files are hosted at this address.
I'm using subdomains (not folders), so sub1.example.com, sub2.example.com, etc. to create new instances.
I'm disallowing registrations, so I'm defaulting to another site altogether in case nothing's there at the subdomain.
The wp-config.php contains the following relevant settings:
define('WP_ALLOW_MULTISITE',true);
define('MULTISITE',true);
define('SUBDOMAIN_INSTALL',true);
define('DOMAIN_CURRENT_SITE','www.example.com');
define('PATH_CURRENT_SITE','/');
define('SITE_ID_CURRENT_SITE',1);
define('BLOG_ID_CURRENT_SITE',1);
define('NOBLOGREDIRECT','https://www.default.com');
define('COOKIE_DOMAIN', false);
if (!defined('ABSPATH'))
define('ABSPATH',dirname(__FILE__) . '/');
define('WP_CONTENT_FOLDERNAME','custom-folder');
define('WP_CONTENT_DIR',ABSPATH . WP_CONTENT_FOLDERNAME);
define('WP_SITEURL','http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_CONTENT_URL',WP_SITEURL . WP_CONTENT_FOLDERNAME);
Now, my question is: assuming I've created a subdomain named "sub1.example.com"
for the new domain "landing-page1.com", what addresses should I ideally use for the Siteurl and Home fields in site-settings.php at the sub1.example.com instance?
Because currently I'm running into an issue where I've entered "http://www.landing-page1.com" for both fields, and "http://landing-page1.com" now consistently reverts to https://www.default.com, while "http://www.landing-page1.com" works as intended (showing the content for "http://sub1.example.com".
Ended up using 3rd party plugin: https://github.com/humanmade/Mercator to create a new alias. Seems superfluous, given WP's built-in domain mapping, but it does the trick.
I want to make a multi-lingual site. Firstly I created a wordpress website. Then I installed wordpress on another site and changed the table prefix of the second site to the one of the first site. So now these sites are sharing the same database and their addresses are http://academy2.hollywoodpress.biz and http://en.hollywoodpress.biz . However, http://en.hollywoodpress.biz is not working but http://en.hollywoodpress.biz/wp-admin is working. How can I fix this problem?
Why you don't use WordPress multi sites feature.
http://codex.wordpress.org/Create_A_Network
You can make WordPress use somewhat dynamic request hostnames using the following in your wp-config.php
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
This way WP will set the site and home URL addresses properly for each domain which is used to request a WordPress page. I think wp-admin will use the value which is determined in the wp_options table (home and siteurl rows).
If you need to display different content on different domains altogether, then you should consider either multisite or two separate WP installations.
If you're only looking to translate content and are OK with either subdomains (en, de, es, etc.) or subfolders (en, de, es, etc.), consider using localization plugin such as Polylang or WPML.
I could solve the problem. The problem was that I used subdomains for separating domains and they didn't work for WPML. I used a domain and I could finally separate domains.
I've been building a wordpress site on a subdomain while having my old website in the root directory. Now I have finished the site and would like to move it into the root. Is there a way how to 'redirect' my site so I don't need to move all the files and databases from the subdomain? The address should appear as www.myweb.com, though.
I have these folders in my FTP:
public_html, _sub, tmp
The subdomain is currently located at _sub/wc/
Thanks!
This codex article should explain the process, I've used it successfully myself several times: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install
According to wordpress you can leave your files where they are and put the following into your wp-config file:
define('WP_SITEURL', 'http://www.example.com/new/');
define('WP_HOME', 'http://www.example.com/new/');
Or you can:
In the box for WordPress address (URL): change the address to the new
location of your main WordPress core files. Example:
http://example.com/wordpress
In the box for Site address (URL): change
the address to the root directory's URL. Example: http://example.com
Take a look at moving wordpress: Moving_WordPress and editing the wp-config Editing_wp-config.php as well as Giving_WordPress_Its_Own_Directory
Wordpress gives a lot of information about moving domains etc, and it is well worth reading their documentation on the matter.
You may want to remove your old website files (it is good to have a back up of the old version anyway) so that they do not conflict (esp if they are WordPress).
I have one installation of wordpress at domain1.co.uk.
I have another domain (domain2.com) and I have changed the A record so that it now points to the installation at domain1.co.uk whist keeping the domain2.com URL.
My issue is when I click any links within the wordpress site the URL changes to domain1.co.uk/pagename and does not retain the .com. I know the wordpress site address is setup to domain1.co.uk at the moment but I would like to be able to retain the domain2.com when visited from domain2.com throughout the site.
Is that possible?
Any help will be gratefully received!
You will either have to use wpmu somehow (wordpress multisite has been integrated into wordpress) or you can enable the wordpress (multisite feature)[http://codex.wordpress.org/Create_A_Network].
It is as easy as:
// wp-config.php
define('WP_ALLOW_MULTISITE', true);
Then going to the network setup tool, adding some more lines to the config, adding some lines to the htaccess, and creating an upload directory.