在浏览器地址栏中的域名上强制使用 CamelCase
我可以强制域名在浏览器地址栏中以驼峰命名法显示吗?所有浏览器似乎都强制域中使用小写字母。这可以通过 .htaccess 文件或其他方式来完成吗?
我一般都同意全小写默认值,但有一位客户提出了要求,并希望给出明确的答案。
Can I force a domain name to appear CamelCase in the browser's address bar? All browsers seem to force lowercase on the domain. Can this be accomplished with the .htaccess
file... or some other means?
I'm generally fine with the all lowercase default, but have a client who has asked, and would like to give a definitive answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的客户显然担心他们不理解的网络方面,并且遗憾的是他们无法改变。
如果不使用 IDN,则按照标准,域名中将禁止使用大写字符,因为大写和小写字母将被视为没有意义。
抱歉,您无法在所有浏览器中明智地执行此操作。
您也许能够购买国际化域名并使用同形异义词[1]来表示大写字符。但这显然是愚蠢的,并且要求您的最终用户拥有能够正确支持此功能的浏览器
[1] http ://en.wikipedia.org/wiki/IDN_homograph_attack
Your client is clearly concerned about an aspect of the web that they do not understand and sadly for them cannot change.
Without using an IDN upper case chars are forbidden in domain names by standards as upper case and lower case are treated without significance.
You cannot do this sensibly in all browsers, sorry.
You might be able to buy an internationalized domain name and make use of Homographs[1] to represent upper case chars. But this is clearly daft and requires your end-user to have a browser that will support this properly
[1] http://en.wikipedia.org/wiki/IDN_homograph_attack
可能值得检查一下为什么客户端希望在浏览器地址栏中使用驼峰式大小写?我的猜测是他们的要求与想要强制驼峰式大小写不同:)
It may be worth checking why the client wants camel case in browser's address bar? My guess is that their requirement is different from wanting to force camel case :)
我一直无法找到任何方法来完成此任务。显然,这是不可能的。
I have been unable to find any way to accomplish this. Apparently, it can not be done.