Phpstudy Apache support. htaccess and No input file specified solution

Source: Internet
Author: User

Apache support. htaccess and No input file specified solution

Locate the httpd.conf file in your Apache installation folder conf

LoadModule Rewrite_module modules/mod_rewrite.so If there is a comment symbol # above, please remove it.
Search the options FollowSymLinks and then modify the allowoverride None below it to allowoverride all;

"1"

Did not expect to meet no input file specified because the project uses the URL route, reckoned may be rewrite problem.

Record the solution.

1. Check if Doc_root sets this value

2. Check the. hta file, many frameworks are index.php when the portal file.

The default

Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]

The rule will cause no input file specified in Apache fastcgi mode.

Modified into

Rewriterule ^ (. *) $ index.php [l,e=path_info:$1]

OK, the address is properly rewritten.

"2"

We all know that the use of pseudo-static relative to the search engine is relatively friendly, and I in the DreamHost space to enable the pseudo-static function of rewrite, the home page can be accessed, while accessing the inside pages, it prompts: "No input file specified."
Baidu Search, found there are other space quotient also has this problem, the reason is that the space used PHP is fast_cgi mode, and in some cases, can not correctly identify the error caused by Path_info, is WordPress also has the same problem, fortunately found the solution!
We first look at the WordPress and Typecho programs, such as the default. htaccess inside the rules:
Rewriteengine on
Rewritebase/
Rewritecond%{request_filename}!-f
Rewritecond%{request_filename}!-d
Rewriterule ^ (. *) $/index.php/$1 [L]

The hint is: "No input file specified.", that is, there is no valid path to the files. 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 "?" in front of the regular result "$". , the problem will be solved with it.

Phpstudy Apache support. htaccess and No input file specified solution

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.