Currently, the URL is mostly in the/xx format, compared? What are the advantages of xx = xx & xx = xx?

Source: Internet
Author: User
Currently, the URL is mostly in the format of xxxx, compared? What are the benefits of xxxx & amp; xxxx? For example? PageNum1 & amp; userId1 compared to pageNum1userId1, the current URL is mostly in the/xx format, compared? What are the advantages of xx = xx & xx = xx?
For example? PageNum = 1 & userId = 1/pageNum/1/userId/1

Reply content:

Currently, the URL is mostly in the/xx format, compared? What are the advantages of xx = xx & xx = xx?
For example? PageNum = 1 & userId = 1/pageNum/1/userId/1

Who told you that URLs are in the/XX format?

/Is the path
? The query

Check the url of google and baidu.

Isn't it more semantic?
xx.php/pageNum/1/userId/1
Users whose userId is 1 to get/delete page 1st (different http methods)

RESTful API

Static address for easy collection

The subject is talking about pseudo-static fixed links .? Xx = xx & xx = xx is the GET value. The two are not compared.

For example/post/edit/1024Finally, rewrite it/index.php?c=post&a=edit&id=1024Or/post.php?a=edit&id=1024To PHP for processing, or directly hand the URI to index. php for analysis, but the former is more RESTful.

Seo ......

This problem happened a while ago.
Is A. net mvc project. The project is a manually configured route (PATH). The leader said that he should follow the first method.
For example, my meeting details page:.../meeting/detail/1The number indicates the meeting Id;
Later, the conference was classified, and the big and small categories were messy. I had to change the display of breadcrumb. I need to add another parameter to solve the problem..../meeting/detail/1/1A lot of list pages cannot go into the details page. Previous list pages all go through this detail page: search, live broadcast, recording, expert, and International waiting. And then changed a lot of files, logic. Wojui, how can it be regarded as completed? It still does not like this form of path, at least the second will not cause a program error.
Later, when the project was launched with professional tools for security detection, a bug was raised: Path.../search/importInaccessible !!
I went to your sister. This is an import search.KeywordsAre you giving me the path?
The url format depends on your personal preferences.

Both of them are acceptable. Not all scenarios are suitable for RESTFul. REST stands in the perspective of all resources, and its creation can only be done through http verbs. Just like java regards everything as a noun. But it is very troublesome. We need to consider various designs .,"? "Rather simple and crude, the speed may be faster (although meaningless to humans ).

The second is targeted direct query by path.

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.