-2

I recently installed wordpress and configured it to have domain mapping, following several websites to get it to work on debian. It was a pain. Recently I took down this server, I tried to back it up but not really sure what to back up in order to preserve the domain mapping capability upon setting up a new server. It was really a pain. I don't use wordpress at all aside from this domain mapping capability.

Can this domain mapping be accomplished purely by say .htaccess and apache? It would seem dumb to rely on wordpress strictly for domain mapping when I don't use wordpress.

1 Answers1

1

It would seem dumb to rely on wordpress strictly for domain mapping when I don't use wordpress.

It sure would!

It looks like you have adopted an extremely convoluted way to achieve what is generally known as Virtual Hosts. Your hunch is right, there is a far easier way.

With DNS you point several domain names to the IP of your server. You then set up Apache to use VirtualHosts to separate them, and point them to different docroots.

You will be glad to know this takes just a few lines of code and is much easier to maintain than an otherwise unnecessary Wordpress install.

See for docs here:

https://httpd.apache.org/docs/2.2/vhosts/examples.html#purename

Tutorials here:

http://www.rackspace.com/knowledge_center/article/how-to-serve-multiple-domains-using-virtual-hosts

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts

JayMcTee
  • 3,923
  • 1
  • 13
  • 22