thinkphp---Set up a route

Source: Internet
Author: User

In a project, after the project is completed, configure the route to make the URL easier to look at.

Here are the specific configurations: common/conf/config.php

// route processing ' url_html_suffix ' = ' html|shtml|xml ',// limit pseudo-static suffix ' url_router_on ' =>ture,/ / Open route ' url_route_rules ' = =array(    '/^doc\/list (\d)/' = ' index/index?p=:1 ',     ' doc/index ' = ' index/index ',    ' doc/:id\d ' = ' index/details ',    ' doc ' = ' index/index ',  ),

After the above configuration is complete:

Access:  /index.php/doc/index   equivalent to access:/index.php/index/index.  HTML Access :  /index.php/doc/2.html  equivalent to access:/INDEX.PHP/INDEX/DETAILS/ID/2.  HTML Access :  /index.php/doc/        equivalent to access:/index.php/index/index.html

thinkphp---Set up a route

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.