Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在URL中,~是什么意思_C#_Url_Sitecore - Fatal编程技术网

C# 在URL中,~是什么意思

C# 在URL中,~是什么意思,c#,url,sitecore,C#,Url,Sitecore,我有一个用C#和Sitecore开发的网站,我有以下URL: 对于某些图像,我不理解此URL以及(~)符号的含义。 它没有保留字符列表,这意味着它没有什么特殊功能。但通常它是一个目录的指示 2.3。无保留字符 URI中允许但没有保留名称的字符 目的被称为无保留。这些包括大写和小写 字母、十进制数字、连字符、句点、下划线和波浪号 在Sitecore中,~/media/是一个URL前缀,用于触发媒体处理程序,进而通知Sitecore该请求是针对媒体库项目的。这些请求的处理方式与站点根目录下的项目请

我有一个用C#和Sitecore开发的网站,我有以下URL:

对于某些图像,我不理解此URL以及(~)符号的含义。

它没有保留字符列表,这意味着它没有什么特殊功能。但通常它是一个目录的指示

2.3。无保留字符

URI中允许但没有保留名称的字符 目的被称为无保留。这些包括大写和小写 字母、十进制数字、连字符、句点、下划线和波浪号


在Sitecore中,
~/media/
是一个URL前缀,用于触发媒体处理程序,进而通知Sitecore该请求是针对媒体库项目的。这些请求的处理方式与站点根目录下的项目请求不同

前缀在web.config的
sitecore/customHandlers
部分中定义:

<customHandlers>
   <handler trigger="~/media/" handler="sitecore_media.ashx" />
</customHandlers>

没人知道,我对“tilde指的是应用程序根目录”一无所知。太好了,谢谢你,德里克
unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
<customHandlers>
   <handler trigger="~/media/" handler="sitecore_media.ashx" />
</customHandlers>
<setting name="Media.MediaLinkPrefix" value="" />
<!-- MEDIA REQUEST PREFIXES
     Allows you to configure additional media prefixes (in addition to the prefix defined by the Media.MediaLinkPrefix setting)
     The prefixes are used by Sitecore to recognize media URLs.
     Notice: For each custom media prefix, you must also add a corresponding entry to the <customHandlers> section
-->
<mediaPrefixes>
  <!-- Example
  <prefix value="-/media"/>
  -->
</mediaPrefixes>