本文介绍了我应该在网址中使用带重音符号的字符吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当人们使用不同于英语的语言创建Web内容时,搜索引擎得到优化并且出现了用户友好的URL。

When one creates web content in languages different than English the problem of search engine optimized and user friendly URLs emerge.

我想知道这是否是最佳做法在网址中使用不带重音符号的字母-冒着某些字词带有或不带有某些重音的含义而具有完全不同的含义-或在适当的情况下坚持使用非英文字符,以牺牲较不高级的URL的可读性环境(例如MSIE,查看源代码)。

I'm wondering whether it is the best practice to use de-accented letters in URLs -- risking that some words have completely different meanings with and without certain accents -- or it is better to stick to the usage of non-english characters where appropriate sacrificing the readability of those URLs in less advanced environments (e.g. MSIE, view source).

异国情调字母可能出现在任何地方:在文档标题,标签,用户名等中,因此它们是并非总是在网站维护者的完全监督下。

"Exotic" letters could appear anywhere: in titles of documents, in tags, in user names, etc, so they're not always under the complete supervision of the maintainer of the website.

一种可能的方法当然是设置备用的-不加强调的-URL,这也将指向原始目的地,但我想了解您有关使用重音网址作为主要文档标识符的意见。

A possible approach of course would be setting up alternate -- unaccented -- URLs as well which would point to the original destination, but I would like to learn your opinions about using accented URLs as primary document identifiers.

解决方案

遇到类似问题时,我利用了允许使用带重音或不带重音的字符访问此类页面。实际的URL类似于

When faced with a similar problem, I took advantage of URL rewriting to allow such pages to be accessible by either the accented or unaccented character. The actual URL would be something like

http://www.mysite.com/myresume.html

并且重写+字符翻译功能允许该引用

And a rewriting+character translating function allows this reference

http://www.mysite.com/myresumé.html

到加载相同的资源。因此,为了回答您的问题,作为主要资源标识符,我将自己限制为0-9,A-Z,a-z和偶发的连字符。

to load the same resource. So to answer your question, as the primary resource identifier, I confine myself to 0-9, A-Z, a-z and the occasional hyphen.

这篇关于我应该在网址中使用带重音符号的字符吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 02:44