Home > Backend Development > PHP Tutorial > javascript - Links without suffix?

javascript - Links without suffix?

WBOY
Release: 2016-08-04 09:21:27
Original
1310 people have browsed it

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?

Reply content:

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template