CodeIgniter Getting Started learning note 09-routing

Source: Internet
Author: User
Tags codeigniter

    • A long long time ago to learn CodeIgniter notes, very casual, but all of their own records, I hope that the people who need help.
    • This article uses word2013 to edit and publish
    • Postbird | There I am, in the world more exciting!
    • Postbird Personal website:http://www.ptbird.cn

      Routing

1. Change the default route file

???? application/config/routes.php

???? Default Controller

????

2, Pseudo-static

???? controllers/article.php

????????

???? Accessing the show_article_id method

???????? Localhost/acodeigniter/index.php/article/show_article_id/

???? Pseudo-static by changing the route. (reg Processing)

???? Access after change

???????? Localhost/acodeigniter/index.php/news/4.html

?

Easy Project Management (date/20150311/4.html) with the following matching

?

3. Apache Rewrite rule---hide portal file

???? Copy the system/.htaccess file to the root directory

???????? Apache needs to support rewriting

???????????? httpd.conf file

???????????????? LoadModule Rewrite_module modules/mod_rewrite.so

????????. htaccess file

???????????? Rewriteengine on

Rewritecond $!^ (index\.php|robots|stafile|upload|\.txt)

Rewriterule ^ (. *) $/acodeigniter/index.php/$1 [L]

???? Access

???????? http://localhost/acodeigniter/news/20160101/4.html????

CodeIgniter Getting Started learning note 09-routing

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.