Thinkphp project deployment error in phpstudy
Not Found
The requested URL /About/index/classid/1 was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
This situation occurred in the root directory of the website. There is no content in .htaccess or the content is wrong.
As shown below, there is no content in htaccess.
At this point we need to add a piece of code to the .htaccess file. The code is as follows:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
After that, the website was still not working, but it was not Not Found. The requested URL /About/index/classid/1 was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
What is displayed is No input file specified.
This error is displayed because
the RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] in the .htaccess file
will cause No input file specified by default.
So We replace the above code with
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
can be solved