1. Current Location: Home >  Router Encyclopedia >  The URL in the address bar is split into five segments, and the hashtag doesn't even go online

The URL in the address bar is split into five segments, and the hashtag doesn't even go online

Five-segment breakdown diagram of URL URLs: What are the protocol domain name, port path, query , parameters, anchor points, and each is responsible for?

Last week, my sister sent me a string of URLs on WeChat, saying she absolutely couldn't open them and asked me to take a look. I laughed when I saw it: the URL was half-broken when she copied it, the path was down to just the first letter, and the rest was gone. She broke the WeChat URL in the middle when she copied it. I sent the full URL back, and she opened it immediately. She even asked me: Which paragraph in this string is important, and which is dispensable?

This question is really worth discussing. The string of things in the address bar is technically called URL. I opened up my blog's URL and tested it overnight. Each of the five sections managed their own tasks, and after figuring it out, when I encountered "URLs won't open," I could basically tell at a glance where the link was disconnected.

First, I dissected a string of URLs: Five sections, each in their own direction

. Using an article

from my own blog as a sample:

https://www.shunot.com/lybk/1069.html

Split from left to right: https:// is a protocol, www.shunot.com This is the domain name, with a port (443) omitted in the middle, and /lybk/1069.html is the path. If the URL were a bit longer, could it still be added later? Parameters and #锚点, like https://www.shunot.com/lybk/1069.html?v=2#comment-8, would make the complete five-segment setup.

For example: the protocol is whether you drive the car or the road you go out; the domain name is the community address, the port is the building number, the path is the number of rooms, the question mark is the message you sent to the owner, and the hash code is your own note "Go straight to the fridge upon entering." The owner can see the message, but the idea of rushing to the fridge is something the owner doesn't know at all—this metaphor will come true later in real life.

What does if ? , you find . . Which page question do you want, it
the paragraph look like? What happensyou type it wrong
Protocol https:// encrypted lane or naked laneintranet devices often fail to open
domain names www.shunot.com find which serverand jump directly to the search page
Port: 443 or :8080server door do you use to connect via the timeout loop
path/lybk/1069.htmlWhich file 404
mark/hash number? v=2#comment-8 Message/Self markwill most likely still be open

Protocol, domain name, and port: In the first half, find the server

.

First, let's do an unconventional test. I changed all domain names to uppercase HTTPS://WWW.SHUNOT.COM/lybk/1069.html to request it, returning 200, exactly the same as before. Because domain names don't matter if it's case-sensitive—you can type it Www.ShUnOt.CoM fine, domain just reports the address to the server, and you don't care about case or lowercase.

Protocol heads usually don't need to be thrown by hand. You type shunot.com and press Enter in the address bar, and the browser automatically adds https:// and www.—that's what it does. But this automatic patching on internal network devices causes problems: when accessing the old router's backend and typing 192.168.1.1, the new browser will default to the https://, while the old device doesn't support encryption at all and just spins a white screen. At this point, you need to manually type all four letters http://. I wrote about this pitfall in the article where I couldn't access the backend >

HTTPS has an extra lock than HTTP, and the transmission process is encrypted. In which situations should you be concerned about this lock, and in which situations you don't need to panic? I've compared packet capture before, and the plaintext clearly shows even the server version number. < a href="https://www.shunot.com/en/lybk/1117.html"> that article explains it in more detail.

Between the domain name and the port, there is also a hidden passage: port. You might never have seen it on the website because it usually doesn't show up—https defaults to 443, http defaults to 80, and browsers save you the trouble. When must a port be written? When the server is not on the default door.

My NAS's music server runs on port 8080. To access, you have to write http://192.168.31.20:8080, not the part after the colon. When the browser knocks on door 80, no one answers. I have written a dedicated article about the principles behind this "house number" set: who sets the numbers 3389, 5005, 554,

The

symptoms of port errors are very recognizable: it's not 404, it's just a constant loop and finally times out. Because 404 is at least "the door is open but the file is gone," and the wrong port means "this door isn't open at all," and the server won't even respond to you.

The path section: a single letter mistake changes the character; case sensitivity is truly sensitive

.

The path is the most precise of the five segments. I tested changing /lybk/ to /LYBK/ to request it, and the server returned a 301 jump, returning a lowercase address to me; Switching to /Lybk/ also makes it 301. My blog's server is pretty good-natured; after implementing compatibility redirects, with a few more detours, you can still get there. But most websites' servers aren't so generous—web servers running Linux have case-sensitive file systems, and the path is two different files, so you can just throw a 404 right in your face.

My sister copied the broken URL string, and the bad part was the path section: the domain name remains, but the path only has the beginning, so naturally nothing can be found. So if a website can't be opened, first check if the path is complete, especially long URLs copied from WeChat or SMS, which are most likely to be broken or broken in lines.

By the way

, domain names and IP addresses can also be used interchangeably. Domain names are essentially translation systems invented to help people remember IPs. You can access them directly by entering the IP address, but nowadays, most websites have multiple sites with one IP address, separated by domain names, so direct IP access often ends up on the default page. I previously wrote about the secrets of IP and domain names, and the article explaining why external networks can't connect to those starting with 192.168 thoroughly explains why.

Question marks and hash signs: one sent to the server, the other only on your computer

.

These are the two most interesting brothers in the five segments, looking alike, but with completely different destinies.

After the question mark is called query parameters. I tested it by adding ?v=20261004 to the end of the URL to request it, and it returned 200, but the content was exactly the same as before—because my server ignored this parameter and gave me the page as is. But the parameter is not just for show: the search page's ?q = keyword, the video site's ?v = video number—all rely on this. You send the search result URL to someone else, and the segment after the question mark is their search term, so send it all over together.

The hashtag after the hashtag is called the anchor point. Here's a real fun fact: I glanced at the packet and saw the URL was #comment-8 for the request. The server received the request line GET/lybk/1069.html—the content after the hashtag never left the network; it only existed in your own browser, used to jump to a certain location after the page loaded. Direct links to comment sections and page directory redirects are all done by it.

This feature has a practical trick: when the webpage gets stuck and old content won't refresh, you can casually add ?123 after the URL and press Enter, which tricks the browser into thinking "this is a new URL" and bypasses the cache to reload it. Of course, the proper method is Ctrl+F5, how to clear four-layer cache. I wrote an article the cache hole in WeChat's built-in browser is also in that article.

The password string for the percent sign: space becomes %20, I've been into the trap of passwords with # for an hour

. The website cannot contain spaces or Chinese characters, these "special characters"; they will be translated into the three-digit cipher text starting with the percent sign: space is %20, and one Chinese character can become nine characters. I tested that I put a bare space in the path to request it, and it couldn't connect at all; After switching to %20, the request is sent normally and returns 404—indicating the server has received it and restored %20 to a space to search for files, except the file with the space doesn't exist.

The most frustrating scenario in this escape is the cipher. I assigned the traffic address to my cousin's surveillance camera, with a hashtag # in the password. No matter how I entered it, it wouldn't connect. After nearly an hour of commotion, I finally realized that the hash code in the URL was the "anchor point start." The server only read the password before it and cut off the password. Change # to %23 and fill in again, instant connection. In cases where passwords are embedded in URLs like camera stream addresses or NAS direct links, the hashtags, t-signs, and spaces in the password must all be escaped according to this set of rules.

Conversely, if you see foreign scripts like %20, %23, %E4%BB%80 in the address bar, don't panic—those are the URL badges with spaces, hash numbers, and Chinese characters, which the browser automatically adds when you copy and paste them.

Conclusion: If the website can't be opened, follow this order to scan five sections

section . A shows . .
First, check whichis most likely the cause
search pagethat protocol/domain address was treated as a search term
The white screen spins in circles to timeout ports, but the port is either not written or written incorrectly
404 Page path copy is half broken or capitalized
The page is cached with an old question mark segment. Add ?123 or Ctrl+F5
to open but not jump to the specified hash segmentMissing anchor or page redesign
.

My sister now knows how to segment URLs. Last month, she even found the utm_source in a URL and asked if it tracked where she came from—those UTM-prefixed parameters after question marks, most likely for this. Delete them and visit again, the page opens as usual, and the world is quiet.

Read More


Copyright Notice Scan to read on mobile
All Rights Reserved: 《SHUNOT》 => 《The URL in the address bar is split into five segments, and the hashtag doesn't even go online》
Article URL: https://www.shunot.com/en/lybk/1131.html
Unless otherwise stated, all articles are original by 《SHUNOT》. Reposting is welcome! Please indicate the original URL when reposting, thank you.

Contact Us

Online Consultation: Click here to send me a message

WeChat ID: master_135

Scan to follow