Report this

What is the reason for this report?

How to change wordpress subDomain to url path

Posted on July 25, 2019

I need to change subDomain to the URL path https://xxxxx.YYYYY.co.th/ to https://YYYYY.co.th/xxxxx

Thanks in advance for your help!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hello,

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 https://xxxxx.YYYYY.co.th/ to https://YYYYY.co.th/xxxxx

Or another approach would be to have a reverse proxy setup in your Apache, so that whenever someone accesses https://YYYYY.co.th/xxxxx they would see the content of https://xxxxx.YYYYY.co.th/

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

https://www.digitalocean.com/community/tutorials/how-to-use-apache-as-a-reverse-proxy-with-mod_proxy-on-ubuntu-16-04

Let me know if you have any questions! Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.