我從Amir發現此帖是關於將請求從google.appspot域重定向到自定義域。我的問題是你在哪裏使用Web2py這樣的東西?如何將appspot域重定向到自定義域?
**To just add a custom domain, just follow the instructions here: http://code.google.com/appengine/articles/domains.html
And once that works, you can put a check in your code to forward anyone landing on the appspot.com domain to your domain: (example in python)
def get(self):
if self.request.host.endswith('appspot.com'):
return self.redirect('www.jaavuu.com', True)
# ... your code ...**
非常感謝你! – 2011-12-31 08:05:51
@Anthony:在項目應用程序中何處保留此代碼? – 2016-02-08 17:51:10
正如答案中所指出的那樣,在第一個模型文件(模型文件按字母順序執行)開始時 - 這樣,它將在任何其他應用程序代碼運行之前重定向。 – Anthony 2016-02-08 17:58:16