How to change wordpress subDomain to url path

Posted July 25, 2019 1.2k views
MySQLApacheWordPressArch LinuxDigitalOcean

I need to change subDomain to the URL path to

Thanks in advance for your help!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


What I would do in this case is to just get rid of the subdomain and move my files to a subfolder under my main site. So it would be something like this:

  • Copy all of your files from your sub domain’s document root to a subfolder in your main site’s document root directory in.
  • Then backup your database
  • After that run a search and replace for your database to change to

Or another approach would be to have a reverse proxy setup in your Apache, so that whenever someone accesses they would see the content of

Here’s more information on how to setup and use reverse proxy:

Let me know if you have any questions!

by Mateusz Papiernik
In this tutorial, you will set up Apache as a reverse proxy using the `mod_proxy` extension to redirect incoming connections to underlying application server(s) running on the same network. There are instructions on setting up a simple web app using the Flask framework to show how Apache interacts with the real application hidden behind it, but you can also follow this tutorial using your existing application server, if you have one.