最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Why my wordpress site URL does not begin with my domain?

programmeradmin1浏览0评论

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/www.

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

But all my wordpress site's pages have an URL like my-app.pro/my-site/www/my-page, and not my-site/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?

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/www.

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

But all my wordpress site's pages have an URL like my-app.pro/my-site/www/my-page, and not my-site/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?

Share Improve this question edited Aug 30, 2019 at 14:56 Benoit Poux asked Aug 30, 2019 at 14:22 Benoit PouxBenoit Poux 12 bronze badges 8
  • 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 Commented Aug 30, 2019 at 14:45
  • In the Settings, the adresses are my-app.pro/my-site/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 Commented Aug 30, 2019 at 15:05
  • Does the site come up when you go to my-site and if so, is it also redirected to my-app.pro/my-site/www? – Ted Stresen-Reuter Commented Aug 30, 2019 at 16:01
  • Is your question connected with WordPress in any way? Server, theme, plugins, but not WordPress. – Max Yudin Commented Aug 30, 2019 at 16:04
  • 1 "In the Settings, the adresses are my-app.pro/my-site/www" - this is what WordPress is using. These are the URLs not the paths on disk. If your site is hosted at my-site then this should just be https://my-site I think? – Rup Commented Aug 30, 2019 at 16:16
 |  Show 3 more comments

1 Answer 1

Reset to default 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 on what they recommend. Their solution involves changing the configuration files.

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

发布评论

评论列表(0)

  1. 暂无评论