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 里增加一行OJBKlocation / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; } }
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: