asp.net mvc 和 unicode 路由和链接
我正在开发一个 unicode Web 应用程序(希伯来语)。 我的路线如下: “SomeUnicodeHebrewWord/{CategoryId}/{CategoryName}/{Page}
当我使用操作链接时,SomeUnicodeHebrewWord 和 CategoryName(也在希伯来语中)正在进行 html 编码。我如何避免这种情况? 我不能使用希伯来语字符创建链接吗?出于 SEO 原因,这很重要。
谢谢!
I'm developing a unicode web application (in hebrew).
and my route looks like:
"SomeUnicodeHebrewWord/{CategoryId}/{CategoryName}/{Page}
When i use the actionlink the SomeUnicodeHebrewWord and CategoryName (also in hebrew) are getting html encoded. how can i avoid that?
can't i have the links created with th hebrew characters? it is important for SEO reasons.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
出于 SEO 原因,避免 HTMLEncoding 和 URIEncoding 并不重要。也许有些搜索引擎不理解这些编码,但这种半途而废的搜索引擎不会影响您的市场成功。只需担心专业的搜索引擎即可;所有专业搜索引擎(我不只是谈论大型搜索引擎,所有)都了解网页的工作原理。
除此之外,我会确保字符串所遇到的每个对象都理解适当的编码(UTF-16 就 .NET 处理的第一级而言,UTF-8 就网络的输入和输出而言)。然而,基于字符串输出 URI 编码(%xx 编码类型,而不是 &#xXXX; 编码)建立链接可能是个好主意,因为与使用此类 URI 相比,一些用户代理遇到的问题较少。 IURI(它们都可以被完美理解,并且被现代搜索引擎视为等效),而更现代的用户代理将对用户隐藏编码,因此您可以获得向后兼容性,而不会伤害现代浏览器或搜索引擎的用户。
Avoiding HTMLEncoding and URIEncoding is not important for SEO reasons. Maybe there are search engines out there that doesn't understand those encodings, but such half-assed search engines aren't going to impact on your market success. Just worry about professional search engines; all professional search engines (and I'm not just talking about the big ones, all of them) understand how web pages work.
Beyond that, I'd make sure that every object the string is met by understands appropriate encodings (UTF-16 in terms of the first level of .NET processing, UTF-8 in terms of input and output to and from the web). However, it may be a good idea to have links based on the string output URI encoded (the %xx type of encoding, not the &#xXXX; encoding) as some user-agents out there have less issues with such URIs than with IURIs (they're both understood perfectly, and as equivalent by modern search engines) while more modern user-agents will hide the encoding from users, so you get backwards-compatibility without hurting users of modern browsers, or search engines.