Dns to another webserver in a subdirectory

I have a website on a server, I have pointed the DNS to his ip, I also have another server , on it I have a wordpress that I will use it that way "mysite.com/ blog ", I will use as a subdirectory not a subdomain, I want to know if it is possible, adjust the dns to show a main site in one server, and the blog in another, already tried to put two ips in the dns did not work, gave conflict , I tried to use the page rules of the Cloudflare pointing the blog to ip, without success, anyway how should I point the dns?

This is not possible with DNS only.

You can either use page rules (you already did but it should work), or configure the webserver to forward the request to the subdirectory of your choice.

But you cannot use the same domain (www.example.com) to redirect to your page and a subdirectory. Only with different ports

In addition to what @MarkMeyer said, you could use a Worker to split the subdirectory to a different IP, you would basically setup a different subdomain for the subdirectory, the inside the joker (so completely transparently to the user) you would request the subdomain and serve it.

Something learned. Unfortunately I don’t have access to the really fancy stuff :joy:

BTT. ^^

What do you mean by that?

Free plan. I use CF for private purposes only.

Back to topic :wink:

1 Like

I believe it will not work in subdirectory, only in subdomain. but thank you all for participating in the discussion.


This topic was automatically closed after 14 days. New replies are no longer allowed.