thinkphp Hidden index.php after 500

Source: Internet
Author: User
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?



Reply to discussion (solution)

 
  
   
  Rewriteengine on# If the directory exists, direct access to the directory does not rewriterulerewritecond%{request_filename}!-d# If the file exists, the file is accessed directly without the following rewriterule. (Do not overwrite if file or file does not exist) Rewritecond%{request_filename}!-f# All files not found the actual path, unified 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.

 
  
   
  Rewriteengine on# If the directory exists, direct access to the directory does not rewriterulerewritecond%{request_filename}!-d# If the file exists, the file is accessed directly without the following rewriterule. (Do not overwrite if file or file does not exist) Rewritecond%{request_filename}!-f# All files not found the actual path, unified 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.



I follow the address of this blog set, that is to say, httpd.conf inside to separate settings, such as a website

 
  
   
      LoadModule rewrite_module modules/mod_rewrite.so//I wrote it here,    ServerAdmin webmaster@dt.e.com    documentroot/web /xx.com    ServerName xx.com    errorlog logs/errun-error_log    customlog logs/acrun-access_log Common
 
  


A single web site will need to open a separate module, can not be configured globally, I follow such a modification after restarting httpd. Yes, but I made a mistake.


Then the problem is still ~

As long as there's one on the global line.



I have this modification after the site root directory does not put the. htaccess file, so prompt, the root directory is also prompted by the bad Request


Request

Bad Request

Your Browser sent a request that this server could not understand.



The first page is 500, I just was directly accessing the module display 400,

And then add xx.com/index.php access to the back.

As long as there's one on the global line.



I found the reason, is created by default. htaccess When the permissions issue, because I am root login, so the permission to create this file is root, I have to set it to
777 permissions, but still the same, just now I try to modify the user groups and users of this site, and then refresh on it.


Thank you, Xu version,
  • 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.