I have a java application run at https://example.com which is hosted on server A. When some access https://example.com/example it should redirect to the WordPress site which is hosted on server B but the URL should be the same https://example.com/example


I suggest you to use subdomain to do this.

ex- https://example.example.com

| improve this answer | |
  • I cant use the subdomain for some other reasons. – Raj Oct 8 at 21:02

I'd run the java in a docker container, then use traefik to serve the main domain and the subdirectory from different containers or hosts.

Or you could use haproxy, then you probably would need to bind the java to another port.

| improve this answer | |

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.