为什么浏览器的URL不能以.com结尾的? [英] Why browser URL cannot end with .com?
问题描述
在我的文章的网站一些用户决定让他们的电子邮件地址,而不是用户名
问题开始当我尝试使用的RouteData重定向到一个页面,URL以.COM结尾,如example@gmail.com是一个有效的用户名,以便他的个人页面将
In my article site some users decided to have their eMail address instead of user name The problem starts when i'm trying to redirect to a page using RouteData and the URL ends with ".com" , for example "example@gmail.com" is a valid username so his personal page will be
http://www.mysite/user/example@gmail.com
正如你可以看到它得到重定向到主页和相对路径被搞砸了,所以图像不显示
As you can see the it gets redirect to home page and relative path gets messed up, so images doesn't show
谁能告诉我,为什么浏览器不喜欢在与.COM结尾的网址的RouteData?
如果您尝试。NET或.org的它会工作,这是用的.com的问题?
Can someone tell me why browsers don't like routedata in their url ending with .com ? If you try ".net" or ".org" it will work, that's the issue with ".com" ?
推荐答案
在Windows中,.com扩展名是用来表示一个类型的可执行文件。你的问题被标记为asp.net - 所以我假设你使用的是IIS。 IIS不管理包含可执行扩展名,如虚拟目录名: .VBS
, .COM
, .EXE
等
In Windows, the .com extension is used to denote a type of executable file. Your question is tagged as asp.net - so I assume you are using IIS. IIS does not manage virtual directory names containing executable extensions such as: .vbs
, .com
, .exe
, etc.
在一个虚拟目录名的可执行文件扩展名(如.com,名为.exe,.dll或.sh),此虚拟目录中的文件不能与Web浏览器查看结束。欲了解更多信息,请参见这里。
When a virtual directory name ends with an executable extension (such as .com, .exe, .dll, or .sh), the files in this virtual directory cannot be viewed with a Web browser. For more info, see here.
您是只需更换一个选项。
以下划线 _
个人网页。所以你上面的例子是: HTTP://www.mysite/user/example@gmail_com
One option you have is to simply replace .
with an underscore _
for personal pages. So your example above would be: http://www.mysite/user/example@gmail_com
这篇关于为什么浏览器的URL不能以.com结尾的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!