apache 与 Nginx 隐藏 index.php 报错 No input file specified. 解决办法

  • Apache
    在.htaccess中修改(如果是框架,则在public下的.htaccess)
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
  • Nginx
    在nginx.conf里增加一行
location / {
	if (!-e $request_filename) {
		rewrite  ^(.*)$  /index.php?s=/$1  last;
	}
}

OJBK

posted @ 2020-06-24 17:35  遗失的美好灬  阅读(185)  评论(0编辑  收藏  举报