0

Let's say I have an site1.example.wordpress.com site, but instead I want me users to see (in their browsers) different link, e.g. example.com. I.e. when someone types example.com it would serve site1.example.wordpress.com but in browser it would display example.com.

I'm aware of this and this solutions. However, I do not want to install the plugin, and the solution that suggests changing TLD in wordpress seems iffy (it's a good solution, that I keep seeing everywhere on the net). However, can a CNAME be used?

And if I add example.com as a CNAME, can I add it just as a ServerAlias (apache 2.4) in my existing vhost for multisite? Or should I make separate virtual host that would reverse proxy to site1.example.wordpress.com?

2
  • Your examples use wordpress.com. Are these sites on wordpress.com? Commented Mar 28, 2018 at 13:06
  • 1
    @JacobPeattie No. Just an example. I'm the root admin of a server, domains are different than the example domains.
    – Gitnik
    Commented Mar 28, 2018 at 13:15

1 Answer 1

0

WordPress Multisite can handle this without a plugin.

What you need to do:

I'm assuming that your WP Multisite installation is at example.wordpress.com and your desired URL for the new site is example.com, per your question.

  1. Create the site in the Network Admin section on example.wordpress.com.
  2. Select Edit Site on the newly-created site.
  3. Change the Site Address (URL) to whatever you need it to be (in this case, example.com.

As long as the DNS resolves correctly, and your webserver knows that example.com is to be served by example.wordpress.com (eg, your example_wordpress_com.conf file in Apache has a line like ServerAlias example.com), you should now be able to go to example.com in your browser and have your new site appear.

See this answer for a couple of screenshots.

2
  • Thanks for the answer Pat. In the mean time I was looking into reverse proxy option and CNAME, but both don't deal with dynamic nature of how a wordpress generates a page. Namely, all links within a page would point to the old domain. So changing the site URL in wp-admin is the only solution. The only problem is this: Will it break the site? So far I haven't got an answer: wordpress.stackexchange.com/questions/299581/…
    – Gitnik
    Commented Apr 4, 2018 at 15:20
  • If you've got command-line access to your server, you can use WP-CLI to change all the links: something like wp search-replace [old-string] [new-string] --url={site-name} --dry-run will show you what needs to be replaced, and then—if you're satisfied—you can run it again without the --dry-run flag.
    – Pat J
    Commented Apr 4, 2018 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.