-1

I'm hosting a web app on my-app.pro, and it's the main domain for the hosting. The containing folder is /home/my-app.pro/www.

I'm using a framework, and it does the rewriting job, so all my pages are reachable at my-app.pro/pages-names/etc

Now I'm publishing another website, a wordpress one, with the Divi Theme, on the same hosting. I put it in this folder /home/my-app.pro/www/my-site.com/www.

The hosting is configured to reach the good folder when my-site.com is typed as an URL.

But all my wordpress site's pages have an URL like my-app.pro/my-site.com/www/my-page, and not my-site.com/my-page as needed (except for the main page, which is working).

How do I change this? Is it in the database directly? Or is it a configuration issue?

  • What do you have for "WordPress Address" and "Site Address" in Settings, General? Why did you put this site inside the my-app.pro/www folder and not some parallel folder that you can add to your web server configuration? Which web server are you using? – Rup Aug 30 at 14:45
  • In the Settings, the adresses are my-app.pro/my-site.com/www. I decided to put it in a different folder to avoid confusion, and to have a better structure for future sites hosting. It's an Apache 2.4 server – Benoit Poux Aug 30 at 15:05
  • Does the site come up when you go to my-site.com and if so, is it also redirected to my-app.pro/my-site.com/www? – Ted Stresen-Reuter Aug 30 at 16:01
  • Is your question connected with WordPress in any way? Server, theme, plugins, but not WordPress. – Max Yudin Aug 30 at 16:04
  • 1
    "In the Settings, the adresses are my-app.pro/my-site.com/www" - this is what WordPress is using. These are the URLs not the paths on disk. If your site is hosted at my-site.com then this should just be https://my-site.com I think? – Rup Aug 30 at 16:16
0

I've had similar issues in the past, hosting two different sites with two domains on one host. Here are the two things that have helped me:

Update WordPress Settings

In the WordPress Admin Dashboard, go to Settings > General.

You'll notice that there's the WordPress Address (URL) and the Site Address (URL). These control where WordPress views the files and the address that the site is viewed at. Double check these. If they are not what you want, then try changing them.

Update Host Settings

Sometimes, to have two different domains on one host you'll have to configure an "Add-on" domain with your host. This usually involves specifying the folder for the second domain, and the problem should be fixed.

If that doesn't work

Here's the link to WordPress.org on what they recommend. Their solution involves changing the configuration files.

https://wordpress.org/support/article/giving-wordpress-its-own-directory/

  • I tried to change the addresses, it causes the site to be unfunctionnal, or to have 404 error on pages. The only change that works, is the Site Address, but it doesn't change anything for the URL, because my-site.com was already working. The host settings update is not necessary, it's already in place and it works to reach my-site.com. Then, the link you gave is interesting, but it says I have to put the index.php file from wordpress to the root and to change some code lines, but I already have an index.php file in this folder, for the my-app.pro site. It involves too much changes. – Benoit Poux Sep 4 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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