gpt4 book ai didi

python - 谷歌应用程序引擎网络应用程序WSGI应用程序中的正则表达式匹配

转载 作者:行者123 更新时间:2023-12-01 06:06:49 25 4
gpt4 key购买 nike

嗨,一个相当简单的问题:

application = webapp.WSGIApplication([
('/result', Result),
('/result/', Result),

唯一的区别是结尾的“/”。

我可以将两个 url 映射合并为一个吗?

最佳答案

出于 SEO 原因,通常最好选择一个 URL 进行处理,并将另一个 URL 重定向到所选 URL。否则搜索引擎会看到重复的内容。例如这样的事情:

class RedirectHandler(webapp.RequestHandler):
def get(self):
self.redirect("/result/", True)

application = webapp.WSGIApplication([
('/result', RedirectHandler),
('/result/', Result),
...

关于python - 谷歌应用程序引擎网络应用程序WSGI应用程序中的正则表达式匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7628187/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com