Dns to another webserver in a subdirectory

dns
pagerules

#1

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?


#2

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


#3

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.


#4

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

BTT. ^^


#5

What do you mean by that?


#6

Free plan. I use CF for private purposes only.

Back to topic :wink:


#7

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


#8

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