ThinkPHP uses URL rewriting to hide the app's entry file index. php

Source: Internet
Author: User
ThinkPHP uses URL rewriting to hide the app's entry file index. php I use apache
[Apache] the mod_rewrite.so module is loaded in the httpd. conf configuration file, removing. AllowOverride None changes "None" to "All". if All the values are modified, 404 is returned. Set the project URL mode to 2. 'URL _ model' => 2. Save the following content as a. htaccess file and place it in the same directory of the application entry file.

 
  
RewriteEngine on # if the directory exists, access the directory directly without RewriteRule RewriteCond % {REQUEST_FILENAME }! -D # if the file exists, access the file directly without RewriteRule. (if the file does not exist or the file does not exist, rewrite it.) RewriteCond % {REQUEST_FILENAME }! -F # all files that cannot find the actual path should be handed over to index. php for RewriteRule ^ (. *) $ index. php/$1 [QSA, PT, L]

  
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.