网址和超链接中的主题标签
hash tags in urls and hyperlinks
我创建了指向文件的超链接。文件名包含主题标签作为分隔信息的方式。
<a href="upload/1427853638#0#file#A101.pdf"><div style="height:100%;width:100%">.</div></a>
翻译成...
http://localhost/dir/upload/1427853638#0#file#A101.pdf
这是 URL 中的 "legal" 名字吗?我收到 "file not found" 错误
The requested URL /dir/upload/1427853638 was not found on this server.
所以,显然 # 在 URL 中有另一个含义(我现在明白了,它是一个位置散列 属性)。有没有办法让它工作,或者我需要在文件名中使用除 # 之外的另一个字符?
由于#
是URL语义中的特殊字符(它用于在HTML页面中提供内部锚点),因此应该是URL-编码成 %23
.
您的 URL 应该是:http://localhost/dir/upload/1427853638%230%23file%23A101.pdf
.
注意:您可以在此处找到在线 URL 编码器:http://meyerweb.com/eric/tools/dencoder/
我创建了指向文件的超链接。文件名包含主题标签作为分隔信息的方式。
<a href="upload/1427853638#0#file#A101.pdf"><div style="height:100%;width:100%">.</div></a>
翻译成...
http://localhost/dir/upload/1427853638#0#file#A101.pdf
这是 URL 中的 "legal" 名字吗?我收到 "file not found" 错误
The requested URL /dir/upload/1427853638 was not found on this server.
所以,显然 # 在 URL 中有另一个含义(我现在明白了,它是一个位置散列 属性)。有没有办法让它工作,或者我需要在文件名中使用除 # 之外的另一个字符?
由于#
是URL语义中的特殊字符(它用于在HTML页面中提供内部锚点),因此应该是URL-编码成 %23
.
您的 URL 应该是:http://localhost/dir/upload/1427853638%230%23file%23A101.pdf
.
注意:您可以在此处找到在线 URL 编码器:http://meyerweb.com/eric/tools/dencoder/