thinkphp Remove index.php (? s=) inside the URL

Source: Internet
Author: User

For example, your original path is http://localhost/test/index.php/home/goods/index.html, so now the address is http://localhost/test/home/goods/. How does index.html remove index.php?
The mod_rewrite.so module is loaded in the 1.httpd.conf configuration file//in Apache to configure the #LoadModule rewrite_module modules/mod_rewrite.so remove the front siren


2.AllowOverride none say none change to all//in Apache to configure (note that other places allowoverride are all set to all) <directory "D:/server/apache/cgi-b In "> allowoverride none Change allowoverride all Options none Order Allow,deny allow from all </Directory>

3. Make sure the config.php inside configuration item Url_model is set to 2 return Array (' url_model ' = ' 2 ',);

4. htaccess file must be placed in the project and directory under this file add: <ifmodule mod_rewrite.c> rewriteengine on Rewritecond%{request_filename}!-d Rewritecond%{request_filename}!-f rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l] </IfModule>

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.