_php tutorial on solving codeigniter pseudo-static failure

Source: Internet
Author: User
Tags codeigniter
Original address: http://127.0.0.1/onsite/index.php/welcome/index/abc123

Modified after address: http://127.0.0.1/onsite/abc123.html

Copy the Code code as follows:

Rewriteengine on
Rewritebase/onsite

Rewritecond%{request_uri} ^system.*
Rewriterule ^ (. *) $/index.php?/$1 [L]

Rewritecond%{request_uri} ^application.*
Rewriterule ^ (. *) $/index.php?/$1 [L]

Rewritecond%{request_filename}!-f
Rewritecond%{request_filename}!-d
Rewriterule ^ (. *) \.html$ index.php/welcome/index/$1 [L]

The rule is not wrong, but million unexpectedly CodeIgniter reported 404 can't find the page, after testing in the root directory to establish the same name of the HTML file can be displayed normally;

The problem should be caused by the configuration of CI; After some twists and turns, a parameter is found:

Copy the Code code as follows:
$config [' uri_protocol '] = ' AUTO ';

Change it to:

Copy the Code code as follows:
$config [' uri_protocol '] = ' path_info ';

The page finally shows normal;

http://www.bkjia.com/PHPjc/781027.html www.bkjia.com true http://www.bkjia.com/PHPjc/781027.html techarticle Original Address: http://127.0.0.1/onsite/index.php/welcome/index/abc123 modified address: http://127.0.0.1/onsite/abc123.html Copy Code The code is as follows: Ifmodule mod_rewrite.c rewrit ...

  • 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.