如果我有类似的东西:
webapp2.WSGIApplication([ (r'/foo/?', FooHandler), (r'/bar/(\d+)', BarPermHandler) ], debug=True)然后结果是/foo和/foo/都由我的FooHandler类和/bar/x ,其中x是BarPermHandler的数字字符串。
我的第一个问题是,这可能会创建两个相同的页面/foo , /foo/而不是让其中一个重定向到另一个,Google的搜索结果肯定会不喜欢。
然而,在考虑/bar/x路径之后我开始怀疑自己 - 我不认为GAE不会为每个可能的整数创建一个页面,直到最大URL长度为止!
所以我的问题是,这些是如何处理的? 哪一个“存在”? 在搜索结果中,用户是否链接到/foo或/foo/或两者?
If I have something like:
webapp2.WSGIApplication([ (r'/foo/?', FooHandler), (r'/bar/(\d+)', BarPermHandler) ], debug=True)Then the result is that both /foo and /foo/ are handled by my FooHandler class, and /bar/x where x is a string of digits by BarPermHandler.
My first concern was that this might create two identical pages /foo, /foo/ rather than having one of them redirect to the other, which Google's search results would surely dislike.
However I started to doubt myself after considering the /bar/x path - I don't think it's much of a stretch to assume that GAE doesn't create a page for every possible integer up to whatever the maximum URL length is!
So my question is, how are these handled? Which one 'exists'? In search results, are users linked to /foo or /foo/ or potentially both?
最满意答案
我真的不知道“创建页面”是什么意思。 GAE根本不创建任何页面,它们都是动态处理的。
正如您所理解的那样,第一个URL的问题不仅仅是有两个类似的URL,而且两个URL都指向完全相同的内容。 相比之下,据推测,BarPermHandler将根据传递的整数显示不同的内容,因此在这种情况下SEO没有问题。
I don't really know what you mean by "creating a page". GAE doesn't create any pages at all, they are all handled dynamically.
The issue for the first URL, as you seem to have understood, is not just that there are two similar URLs, but that both URLs point to exactly the same content. By contrast, presumably BarPermHandler will show different content depending on which integer is passed, so there is no problem with SEO in that case.
更多推荐
发布评论