I deployed a website (it consists of one index.html page and folders that contain js, image & css files) on the app-engine and linked it to my custom domain. I configured the CNAME and the site is opening on my domain, but the original appspot URL is not being redirected to the custom domain.
I did come across pages with similar questions which discussed about this problem. I tried implementing those, but they didn't seem to work.
Here is what I did, in the **app.yaml** file I replaced:
- url: /.*
static_files: static
upload: static
with
- url: /.*
script: main.application
and in the **main.py**, I erased all the content and added the following:
import webapp2
from google.appengine.ext.webapp.util import run_wsgi_app
application = webapp2.WSGIApplication([
webapp2.Route('/', webapp2.RedirectHandler, defaults={'_uri':'http://subdomain.domain.com}),
], debug=False)
def main():
application.run()
if __name__ == '__main__':
main()
But it doesn't seem to work. The appspot URL is not being redirected but my custom domain is working alright. What changes should I make in the above code to make the redirection possible?
Thanks!