Rewrite rule to mock domain name - wordpress

Is there a way to mock a domain name with another one parked on the same server?
I'm using WordPress with WPML plugin for multilanguage. WPML has an option to use different domain names for different languages, using parked domains. My problem is that I want to have more than one domain name for a specific language. Let's assume that domain.co.uk, domain.us and domain.com should all deliver EN, but WPML only allows me to set domain.com for EN.
Is there a way to trick the server to make it look like a different domain was requested? For example, when I'm accessing: www.domain.us/some-address/here I need it to serve the exact same content as www.domain.com/some-address/here would, without redirecting.
Thanks!

Related

Add NGINX redirect to specific URL

So I have a nice wordpress site, which has a translation. for example, this translation is located at https://example1.com?lang=fi
I also have another domain. https://example2.fi
How do I get the other domain to redirect to the translated url? and how do I make sure the https://www.example2.fi goes as well?
My provider gives me access to add custom nginx configs.
Alternately, is it better to do these kind of redirects in wordpress?
I have modified the dns already to point example2.fi to the correct ip.

How to use another domain for a specific url?

I'm building a WordPress website for a client and can't figure out what to do here. I'm using translatepress to make my website multilingual and the client wants to have another domain for different language. So the default domain is example.com but English version is example.com/en . Is it possible to add another domain which replaces example.com/en and is still functional by pressing all the links? So it's like example2.com points to example.com/en , but not as a url forwarding, but it replaces the whole example.com/en part completely. What are my options here? Thanks.
You can have different sites in a network on different domains. It is just on the other domain, not on both. Since WP stores internal links as absolute URLS, you need to create the sites on the correct domain from the start, or use wp-cli or similar to re-write existing links when you change.
I was about to recommend the plugin I have used, but see from https://wordpress.org/support/article/wordpress-multisite-domain-mapping/ that from 4.5 it's a WP native feature!
Note: i don't use translatepress but have different languages as different sites in a network. Since you talk about sub-domains I'm assuming you do something similar

Wordpress Multisite - Mapping Multiple Domain Names - As Primary

Alright, the primary domain is: gdengines.com. I also own .net & .org. I want it so if a user types in .net or .org it will display the primary domains contents. However, the LINKS will be for that URL (the easiest way to explain this is by using the following plugin as an example:
Multiple Domain (plugin page) - Multiple Domain allows you having more than one domain in a single WordPress installation. When there is more than one domain set in your host, all links and resources will point to the default domain. This is
the default WordPress behavior. With Multiple Domain installed and properly configured, it’ll update all link on the
fly. This way, the user navigation will be end-to-end under the same domain.
However, the plugin doesn't work with multisite installations.
I have WordPress MU Domain Mapping installed, but it's not helping for this issue.
Anyone know a fix other than setting up .net & .org to redirect?
You can use on the other domains .htaccess file with.
Redirect 301 / http://www.your-url.com
If you have to on each domain then redirect the vistor automatic to your main domain.

pointing domain to wildcard sub sub domain

I have a multisite wordpress install at plataforma.vendamais.pt
And I have a wildcard for *.plataforma
So all new sites created have this url:
client01.plataforma.vendamais.pt
client02.plataforma.vendamais.pt
and so on.
I need to connect my client's domains to the correspondent website, so the url client01.plataforma.vendamais.pt wont be visible.
As a real case, I have a client's website here:
www.tancredoferrari.plataforma.vendamais.pt/
I need to have his domain tancredoferrari.pt pointing to that address, so his clients will navigate using tancredoferrati.pt and wont see any of the www.tancredoferrari.plataforma.vendamais.pt url.
Is it possible?
There's 2 options here:
Option 1
An CNAME record on the live domain's DNS should be sufficient to do this - so long as you're happy that the resource requests (images, scripts, styles and so forth) behind the scenes are going to the staging domain URLS (client02.plataforma.vendamais.pt and so forth).
Option 2
Check out the wordpress plugin WordPress MU Domain Mapping. With that you can map the site to multiple domains (and set the primary), which is a better approach.

Anyone familiar with Wordpress MU domain mapping? Need desperate help please

We have the Wordpress MU Domain Mapping plugin installed and have followed instructions to the best of our ability but we can't seem to get this working at all and I've tried everywhere to get advice but no-one seems to know anything about it...
Here's the scenario.
We have Wordpress MU installed at (eg) abc.com so each new Wordpress site we create is then at (eg) site1.abc.com, site2.abc.com, site3.abc.com etc. These are all virtual sub directories and Wordpress MU does not generate any physical sub directories for site1, site2 and site3.
What we wish to do, is purchase new domain names and map them to each one of these sub Wordpress sites. (eg) mynewsite1domain.com will be mapped to site1.abc.com so instead of the site appearing as the following in the visitors browser address bar...
site1.abc.com
site1.abc.com/about
site1.abc.com/contact
...the URL's would appear as...
mynewsite1domain.com
mynewsite1domain.com/about
mynewsite1domain.com/contact
This particular setup is on a VPS running Plesk CPanel, I have complete access to everything including SSH if anyone can advise how on earth this setup is meant to be correctly configured to function as explained above.
I'm guessing something needs to be done with DNS records, at the domain registrar for mynewsite1domain.com, we have the name servers pointing to the VPS IP that the Wordpress MU setup resides on.
Any help would be greatly appreciated.
Thanks in advance.
Are you using WordPress Multisite 3.3.X or an older implementation of WordPress MU (or the MU plugin from a third party)? Likewise, to accomplish domain mapping, are you using the official domain mapping plugin from Automattic or another third party implementation? It sounds like you are using subdirectory vs subdomain multisite. That is not how domain mapping is typically used (the Automattic version at least).
You shouldn't have to point the new domain names to the server's DNS (unless you want it to be the authority), you'll just need to assure that the new domain names resolve to the same IP address of the main web server (an A record should suffice). The domain mapping plugin is pretty straight forward on how to map what domain name to what subdomain and whether you wish to have it redirect or use the new domain name in the address bar. The later would give you what you seek with mysite1domain.com/subfolder, etc.

Resources