thinkphp Remove index.php

Source: Internet
Author: User

 
For example your original path is http://localhost/app/index.php/module/action/var/value/
So now the address is http://localhost/app/module/action/var/value/

remove index.php

1 . The mod_rewrite.so module is loaded in the httpd.conf configuration file   //in Apache to configure the

#LoadModule rewrite_ Module modules/mod_rewrite.so Remove the previous siren from

2 . AllowOverride none  say None to all      //in Apache inside to configure ( Note that other places allowoverride are all set to all)

allowoverride none   Change    allowoverride all
Options None
Order allow,deny
allow from all


3 . Make sure Url_model is set to 2 and write in the project's configuration file
Return Array (
    ' url_model ' = ' 2 ',
);

4  .htaccess file must be placed in the following directory
This file added:

rewriteengine on
Rewritecond%{request_ FILENAME}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]

thinkphp Remove index.php

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.