<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>连字符归档 - 日志</title>
	<atom:link href="https://www.log.show/tag/%E8%BF%9E%E5%AD%97%E7%AC%A6/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.log.show/tag/连字符/</link>
	<description>LOG.SHOW</description>
	<lastBuildDate>Fri, 05 Dec 2025 01:36:44 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://www.log.show/wp-content/uploads/2025/11/cropped-logo-32x32.png</url>
	<title>连字符归档 - 日志</title>
	<link>https://www.log.show/tag/连字符/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>为什么不应该在超链接中使用下划线</title>
		<link>https://www.log.show/log/why-should-we-not-use-underscores-in-hyperlink/</link>
					<comments>https://www.log.show/log/why-should-we-not-use-underscores-in-hyperlink/#respond</comments>
		
		<dc:creator><![CDATA[LOGGER]]></dc:creator>
		<pubDate>Sat, 08 Nov 2025 09:11:27 +0000</pubDate>
				<category><![CDATA[LOG]]></category>
		<category><![CDATA[Hyperlink]]></category>
		<category><![CDATA[Hyphen]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Underscore]]></category>
		<category><![CDATA[URL Structure]]></category>
		<category><![CDATA[URL结构]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[下划线]]></category>
		<category><![CDATA[搜索引擎优化]]></category>
		<category><![CDATA[用户体验]]></category>
		<category><![CDATA[网页开发]]></category>
		<category><![CDATA[超链接]]></category>
		<category><![CDATA[连字符]]></category>
		<guid isPermaLink="false">https://print.surf/?p=13</guid>

					<description><![CDATA[<p>在链接里用下划线“_”其实是个小坑！它会让搜索引擎困惑，不利于SEO；看起来也不够清晰，容易和链接自带的样式混淆；甚至在某些情况下还会引发404错误。所以，记得用短横线“-”来分隔单词，这才是更友好、更专业的选择哦！</p>
<p><a href="https://www.log.show/log/why-should-we-not-use-underscores-in-hyperlink/">为什么不应该在超链接中使用下划线</a>最先出现在<a href="https://www.log.show">日志</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">首先，超链接中可以使用&#8217;_&#8217;吗？</p>



<p class="wp-block-paragraph">可以。</p>



<p class="wp-block-paragraph">但是不推荐。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">一、不利于SEO</h2>



<p class="wp-block-paragraph">搜索引擎会认为 <code>aaa_bbb</code> 是一个连词，从而识别为这是一个整体单词 <code>aaabbb</code> 。例如你搜索 <code>my_site</code> ，搜索引擎会认为你搜索了 <code>mysite</code> 而非 <code>my site</code> 。而在链接中使用 <code>-</code> 会让搜索引擎认为这是分词符，从而输入更多的准确的关键字。可以参考<a href="https://developers.google.com/search/docs/crawling-indexing/url-structure?hl=en&amp;visit_id=638635334556049207-4053290024&amp;rd=1">Google的说明文档</a> 。</p>



<p class="wp-block-paragraph">进而，在用户进行搜索时，搜索引擎可能会忽略你的网站内容。</p>



<h2 class="wp-block-heading">二、利于分辨</h2>



<p class="wp-block-paragraph">友好的内容不仅应该方便机器读取，更应该首先考虑人的感受。那么从人的角度来说为什么不应该使用下划线</p>



<ol class="wp-block-list">
<li>下划线同样会给人一个“这是个长单词的感觉”。没有人会记住你想表达的内容。</li>



<li>一般的超链接的样式会设置为下划线和蓝色，如果你的链接内带有下划线，有可能会和样式产生重叠和遮挡。</li>



<li>如果超链接在文本中进行展示时，当你有一个比较长的链接，比如： <code>site.com/this_is_a_very_long_link_on_my_website</code> 。人在试图读这个链接时，眼睛会不由自主地跟随下划线移动。这似乎不太合适。</li>
</ol>



<h2 class="wp-block-heading">三、约定俗成的习惯和莫名其妙的bug</h2>



<p class="wp-block-paragraph">一般在计算机领域，我们在本地文件会使用下划线内容。然后上传文件后对外提供的链接就会是这样： <code>http://site.com/file_name.txt</code> 。但是这样会出现一个问题：在互联网传播时，浏览器内复制粘贴会将 <code>_</code> 转义为 <code>%5F</code> ，如果服务器没有进行配置，那你的超链接的文件就会404。而且貌似<a href="https://meta.stackexchange.com/questions/16004/link-with-underscore-does-not-work">很多知名公司都有这个问题</a><br>（现在可能已经被修复）。</p>



<h2 class="wp-block-heading">四、在域名中不合法</h2>



<p class="wp-block-paragraph"><a href="https://datatracker.ietf.org/doc/html/rfc1738">RFC1738</a>和<a href="https://datatracker.ietf.org/doc/html/rfc1035">RFC1035</a>等多次投票结果的规则中对域名中出现 <code>_</code> 表示禁止。也对以前申请了证书的带有下划线的域名的证书进行了回收和禁止续费。但这只是顶级域名的要求，而不是对于顶级域名下的子超链接和文件的限制。</p>



<p class="wp-block-paragraph">其实只是很久以前看过的一个博客。说的是在美国军队中导致的一些问题从而禁用了下划线，最近想到了就重新整理一下写成文章分享出来。</p>
<p><a href="https://www.log.show/log/why-should-we-not-use-underscores-in-hyperlink/">为什么不应该在超链接中使用下划线</a>最先出现在<a href="https://www.log.show">日志</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.log.show/log/why-should-we-not-use-underscores-in-hyperlink/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
