简体   繁体   中英

Redirecting domain to another domains specific url using google cloud app engine

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM