I have a simple website at https://karra-asynk.appspot.com which has been live for many years. Recently I bought a domain http://asynk.io/ and set it up to point to my appengine application. The problem is when I search for ‘asynk’ or any related keyword, google only shows the appspot urls in the search results. Anyway I can point all of those to my custom domain?
3
Answers
You can add a check for the requested domain and if it’s the appspot subdomain, then redirect to the same path under the new domain. After that you just need to wait. It takes time to update the Google index and it depends the amount of links to your site (that Google knows of), so if your site is listed in places you have control of – update the links to the new domain.
You may also consider serving different robots.xml depending on the requested domain – for the old subdomain serve it with “Disallow: /” to prevent indexing it, however that doesn’t necessarily mean that the new domain will be listed in Google instead for the same search, at least not until some time has passed.
Make sure you are redirecting your
.appspot.com
requests to your new domain with the 301 redirect code.You can also use Google Webmaster’s “Change of address” tool.
Just add middleware at the top of
MIDDLEWARE_CLASSES
ofsettings.py
in my case
in
models.py
Note: The static files cannot be handled using this.