JavaScript-a link without a suffix name?

Source: Internet
Author: User
See a tag like this on a website , no suffix, click can jump to the new page, how do you realize this?

Reply content:

On a website to see such a tag , no suffix, click can jump to the new page, how do you realize this?

In fact, no matter what kind of URL, is essentially a string of characters, as to how to parse this string of characters, mainly the server implementation.

无才狂士The answer is clear,
Before Ah, url is like this www.x.com/xx/index.html , is really there is a index.html file, url directly pointing to this file can be opened,
With rewrite, ' www.x.com/xx/index.html can point to a task resource, which can be an HTML file, or it can be a picture, video, etc.
After the server receives the request, according to the rewrite rule, locate xx/index.html the point and return the appropriate resources to the client.
Now the .html suffix basically has no meaning, but .html to search engine friendly, we also used to use .html as a suffix.
In some interfaces, suffixes have special meanings, such as /xx/index.html returning html format data, /xx/index.json returning json format data,

How HTML implements it, how it is implemented, Configure Web. XML, or view resolver, you have to ask him directly how to achieve, too general, also may be blocked by the filter, and then according to their own rules to resolve the actual image address, and the process of parsing, you can solve a lot of problems, such as hotlinking, picture resource switch, picture distributed ...

Not see, not pictures ah, but the same reason, now I use STRUS2, requests are xxxx.do, as to how to come, just configure the line, configuration of a lot of ways

Mlgj.
FIRM_CN_C4EE755E2E3F111B6CE715D7E99E0B3B This is the folder name

Routing settings OK, you will JS can see the route section of the Express

Appache has a rewrite module, which is redirect.

Isn't that what the servlet is?

Web. XML configuration

Do you have to bring a suffix to the link? You visit Baidu, do you want to add the suffix name? The same reason.

The main service can parse this mysterious string routing rule, even if it's www.a.com/123.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.