Thinkphp hides index.php after 500

Source: Internet
Author: User
thinkphp Hidden index.php after 500
System linux+php5.3
tp3.1.2

Modify Httpd.conf's mod_rewrite.so module semicolon according to the Handbook of TP
And then there's allowoverride none to change none to all (this place in the httpd.conf there are 5, I have changed into all, do not know whether it is correct, or just need to modify a place on it? )

Url_model set to 2 This is also set to 2 in the config file, and then in writing one. Htaccess is placed in the root directory of the site, the content is as follows


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


And then restart the httpd, the results suggest that the Internal Server Error, at the beginning I thought it was my Apache problem, and finally I see the other site is normal (this Linux has multiple sites), and finally put. htaccess to open the site after the return to normal, If there is a problem with the htaccess, it can be explained. htaccess there is a problem, is not the content of this inside there is a problem, or need to php.ini in setting up the other?



------Solution--------------------
 
  
  
   
Rewriteengine on

#如果目录存在就直接访问目录不进行RewriteRule
Rewritecond%{request_filename}!-d
#如果文件存在, the file is accessed directly without the following rewriterule. (Do not overwrite if file or file does not exist)
Rewritecond%{request_filename}!-f
#所有找不着实际路径的文件, the unified handing over to index.php processing
Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]

TP itself with. htaccess

You look at this http://blog.csdn.net/qq1355541448/article/details/21375407.
  • 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.