Apache support. htaccess pseudo-static rewrite error No input file specified solution _linux

Source: Internet
Author: User

Find the httpd.conf file in your Apache installation folder conf
Search LoadModule Rewrite_module modules/mod_rewrite.so If there is an annotation symbol on the front, remove it.
Search for the options followsymlinks and then modify the allowoverride None below it to allowoverride all;


Did not expect to meet the no input file specified because the project used the URL route, guessed that may be rewrite problem.
Record the solution.
1. Check whether Doc_root set this value
2. To check the. hta files, many of the frameworks are index.php when the portal files.
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 rewritten properly.


We all know that the use of pseudo static relatively, the search engine is more friendly, and I dreamhost in the space to enable rewrite pseudo static function, the home page can be accessed, and access to the pages when the prompt: "No input file specified."
Baidu search for a while, and found that there are other space vendors also have this problem, because the space used PHP is fast_cgi mode, and in some cases, can not correctly identify the error caused by path_info, that is, WordPress also has the same problem, fortunately found a solution!
We first look at WordPress and Typecho and other programs default. htaccess inside the rules:

Rewriteengine on
rewriterule ^ (. *) $/index.php/$1 [L]

The hint is: "No input file specified.", which means that no valid file path is obtained. The solution, found in Google, is to modify the pseudo static rules as follows:

Rewriteengine on
rewriterule ^ (. *) $/index.php?/$1 [L]

Add a "?" in front of the regular result "$". Number, the problem is solved.

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.