MVC URL Definition Recommendations

Source: Internet
Author: User

Here are some suggestions for using URLs:

      1. It is best to visually see the meaning of the URL, and do not define the URL with specific information about the application. For example, using/articles/report is better than using/website_v2/cachedcontentserver/fromcache/report.

      2. Using a content title is better than using an ID. For example, using/articles/annualreport is better than using/articles/2392. If you must use an ID (such as sometimes you might need to distinguish the same title), then both are used, such as/articles/2392/annualreport, which looks very long, but more user friendly, and more conducive to SEO.

      3. Do not use a file name extension (such as. aspx or. mvc) for Web pages. However, for special files, use extensions (such as. jpg,. pdf,. zip, and so on).

      4. Use the URL of a hierarchical relationship, such as/products/menswear/shirts/red, whenever possible, so that users can guess the parent URL.

      5. Case-insensitive, so user-friendly input.

      6. Use Get and post correctly. Get is typically used to get read-only information from the server, and post is used when an action is required to change state.

      7. Avoid using marker symbols, code, character sequences, and so on whenever possible. If you want to delimit with a marker, use an underscore (such as/my-great-article), the underscore is unfriendly, and the space and + numbers are encoded by the URL.

      8. Don't change URLs easily, especially for Internet sites. If you must change it, keep the original URL as long as possible.

      9. Try to get URLs to use a uniform style or habit.

MVC URL Definition Recommendations

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.