1

I am trying to redirect other domain to my domain by setting up the my domains nameserver to another domain. Ex. My Domain: example.com Created Nameserver: ns1.example.com

Other domain: domain.com Set Nameserver : ns1.example.com

When i open domain.com so it has to redirect on example.com/redirected/domain.com

I don't know How to do it on Google App Engine. How can i achieve that using Spring boot application on Google App engine or is there any way to do that?

1 Answers1

0

In case you have both domains in App Engine, you can route from one service to another using dispatch.yaml. In the documentation there is an example, as it is stated there:

The following is a sample dispatch file that routes requests to http://simple-sample.appspot.com and requests like http://simple-sample.appspot.com/favicon.ico to the default service. All static content is served from the default service. Mobile requests like http://simple-sample.appspot.com/mobile/ are routed to a mobile frontend, and worker requests like http://simple-sample.appspot.com/work/ are routed to a static backend.

And here's the configuration:

dispatch:
  # Default service serves the typical web resources and all static resources.
  - url: "*/favicon.ico"
    service: default

  # Default service serves simple hostname request.
  - url: "simple-sample.appspot.com/"
    service: default

  # Send all mobile traffic to the mobile frontend.
  - url: "*/mobile/*"
    service: mobile-frontend

  # Send all work to the one static backend.
  - url: "*/work/*"
    service: static-backend

There are more possible configurations and description of the syntax in the documentation. Also it is important not to forget to deploy with:

gcloud app deploy dispatch.yaml
iker lasaga
  • 330
  • 1
  • 3
  • 18
  • Okay but will it work on domains. Because there is a list of domain. There domains want redirected to mydomains specific url – Harshal Chandekar Feb 04 '20 at 05:38
  • This configuration redirects the traffic to an App Engine service. If you want to redirect it to a domain specifically, it has to be done in the code. I found this other stackoverflow thread that explains it https://stackoverflow.com/questions/1058119/how-to-redirect-all-urls-with-google-app-engine/9428268 – iker lasaga Feb 04 '20 at 08:15