[1]
I did not expect to encounter no input file specified because the project uses URL route, it may be a rewrite problem.
Record the solution.
1. Check whether doc_root sets this value.
2. Check the. HTA file. Many frameworks use index. php as the entry file.
Default
Rewriterule ^ (. *) $ index. php/$1 [QSA, PT, l]
In Apache FastCGI mode, the rule causes no input file specified.
Modify
Rewriterule ^ (. *) $ index. php [L, E = path_info: $1]
OK. The address is rewritten normally.
[2]
We all know that the use of pseudo-static is relatively friendly to search engines, and the homepage can be accessed when I enable the pseudo-static function of rewrite IN THE dreamhost space, when accessing the internal page, the system prompts "no input file specified. ".
Baidu searched and found that other space vendors also had this problem because the PHP used in the space is fast_cgi mode. In some cases, the path_info error cannot be correctly identified, that is, WordPress has the same problem. Fortunately, we found a solution!
First, let's take a look at the rules in the default. htaccess program such as WordPress and typecho:
Rewriteengine on
Rewritebase/
Rewritecond % {request_filename }! -F
Rewritecond % {request_filename }! -D
Rewriterule ^ (. *) $/index. php/$1 [l]
The prompt is "no input file specified.", that is, no valid file path is obtained. The solution found in Google is to modify the pseudo-static rules as follows:
Rewriteengine on
Rewritebase/
Rewritecond % {request_filename }! -F
Rewritecond % {request_filename }! -D
Rewriterule ^ (. *) $/index. php? /$1 [l]
Add a question mark (?) before the regular expression "$1". .