What does it mean to add a backslash (index.php/xx) behind PHP?

Source: Internet
Author: User
Like what

domain.com/index.php/user/123

    1. What is the meaning of this writing?
    2. How is compatibility? are all PHP servers and browsers supported
    3. Is this a standard notation?

Reply content:

Like what

domain.com/index.php/user/123

    1. What is the meaning of this writing?
    2. How is compatibility? are all PHP servers and browsers supported
    3. Is this a standard notation?

/user/123 is Path_info, which is defined in the CGI specification, and most of the framework uses this value for route rewriting.

I've just studied this before: http://weizhifeng.net/difference-between-php_self-script_name-script_filename-path_info-and-request_uri.html.

The CGI specification can be seen here: http://www.perlfect.com/articles/cgi_env.shtml

This is written just for the convenience of programming, not a standard,

index.php mainly acts as a controller in MVC, that is, all requests first to index.php this file. Implement a single entry. Then do "hands and feet" in the index.php file, according to the request of different URLs, routed to the corresponding handler to do the specific processing. Example: domain.com/index.php/user/123

index.php first receives the request, and then, based on the URL, passes the request to user.inc (assuming) the file, the ID is 123, and is returned to the browser after processing.

URL Rewrite is all you can do

  • Related Article

    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.