We know: SEO is basically semantic, convenient for search engines to grab, but this is about the traditional multi-page application in the single page application has not been transformed semantic effect on SEO

First look at the search engine principle

Will this URL search engine with # be included?

1. What is a hash?

In an article on Nguyen Yifeng’s blog, the hash value is not an HTTP request, but a browser action. With #, you can quickly navigate to a specific location in the web page. For example, you quickly locate to id=”comment-121″ or this location.

2. Will search engines grab urls with hash numbers

The answer is probably not. Search engines must first follow the HTTP protocol to crawl pages, but # is not part of the protocol. And in fact, we have not seen a search engine search results, which records can be quickly located to a certain location within the web page. Therefore, it is unrealistic to expect that by adding anchor links with # inside and outside the site, search engines will be able to quickly locate their first visit. Of course, in order to simulate real users, search engine spiders will use some technology to simulate the effect of mouse clicks after entering the site. At this time, the page’s anchor link still works, but any link in the search results, will not take #.

3. #! What does it do?

This is a special case of violation 2, where Google will crawl with #! The URL. Google says that if you want Ajax generated content to be read by the browsing engine, you can use “#!” in the URL. (This kind of URL usually doesn’t have a location effect on a normal page), Google automatically converts the content behind it to the value of the query string _escaped_fragment_. Such as / #! /username is the same as /? Escaped_fragment =/username, with? The URL of #! “Will be indexed by Google.

4, the search engine will not grab the # number (hash) URL to our enlightenment

Do not try to block # urls with robots.txt. I was looking over the error of adding the disallow:/*# rule to the robots.txt file in an attempt to block these # urls from being fetched. First of all, # isa comment symbol in robots.txt, and the content after it will be commented out, so this rule changed to disallow:/, that is, to block all pages of this site. Fortunately, I found this morning, and immediately changed. Second, search engines don’t grab urls with #, so there’s no need to add such a rule.

Second, you can use # in combination with Ajax to hide content that you don’t want to be captured. In some of our web pages, there may be some content that we do not want to tell the search engine directly, or some privacy that we do not want to be captured, so we can use # to control the display of these information. For example, let’s add a button that displays 123’s personal information when the URL has #show-info-123 in it, but not when it doesn’t. As for the search engine, the URL with # will be ignored automatically, so the personal information of 123 will not be captured.

That said, semantematization of hash patterns has little effect on SEO, and it’s not just for SEO