I saw such an a tag on a website<a href="/firm_CN_c4ee755e2e3f111b6ce715d7e99e0b3b" >
. There is no suffix. Clicking it will jump to a new page. How do you achieve this?
I saw such an a tag on a website<a href="/firm_CN_c4ee755e2e3f111b6ce715d7e99e0b3b" >
. There is no suffix. Clicking it will jump to a new page. How do you achieve this?
In fact, no matter what kind of URL, it is essentially a string of characters. As for how to parse this string of characters, it is mainly implemented by the server.
Talentless Madman
The answer is very clear.
In the past, the URL was like thiswww.x.com/xx/index.html
. There really was an index.html
file, and the URL pointed directly to this file. It can be opened.
With rewrite, `www.x.com/xx/index.html can point to task resources, which can be html files, pictures, videos, etc.
After the server receives the request, according to the rewrite rules , find the place pointed to by xx/index.html
, and return the corresponding resources to the client.
Now the .html
suffix is basically meaningless, but .html
is friendly to search engines, and everyone is accustomed to using .html
as the suffix.
In some interfaces, the suffix has special meaning, such as /xx/index.html
returns html
format data, /xx/index.json
returns json
format data,
.html is implemented how it is implemented. Configure web.xml or view parser. You have to ask him directly how to implement it. It is too general and may be intercepted by filters. Then the address of the actual image is parsed according to your own rules. , and the parsing process can solve many problems, such as hot links, image resource switching, and image distribution. . .
I didn’t see it clearly. It’s not a picture, but the principle is the same. Now I use strus2, and the requests are all xxxx.do. As for how it comes from, it just needs to be configured. There are many ways to configure it
mlgj.
firm_CN_c4ee755e2e3f111b6ce715d7e99e0b3bThis is the folder name
Just set up the route. If you know js, you can check out the route part of express
Appache has a rewrite module, which is redirection.
Isn’t that what servlets are?
web.xml configuration
No one stipulates that links must have a suffix, right? When you visit Baidu, do you need to add a suffix? The same reason.
The main thing is that your server can parse this set of mysterious string routing rules. Even www.a.com/123