bo-blog / bw

Bo-blog Wind Version
MIT License
95 stars 21 forks source link

编写伪静态规则后,出现:No input file specified. #66

Open dqcser opened 7 years ago

dqcser commented 7 years ago

点击日志链接时出现如题的提示。 目录路径是正确的,在本地测试是OK的,应该是空间商的问题。 请问大大,写法要怎么写才可以正常?小白请教

dqcser commented 7 years ago

另外还有个问题,我一直在尝试修改伪静态代码,除了开启URL重写功能,保存了.htaccess之后,没改动过其它文件。 一刷新主页,变成以下提示: Warning: array_key_exists() expects parameter 2 to be array, null given in /home/u786519756/public_html/bw/inc/view.inc.php on line 202

Warning: array_key_exists() expects parameter 2 to be array, null given in /home/u786519756/public_html/bw/inc/view.inc.php on line 202

Warning: array_key_exists() expects parameter 2 to be array, null given in /home/u786519756/public_html/bw/inc/view.inc.php on line 202

dqcser commented 7 years ago

将代码改变一下,在本地测试OK,在主机上,还是:No input file specified 代码改变写法的部分: RewriteRule ^index/([0-9]+)/?$ index.php/$1/ [QSA,L,E=PATH_INFO:$1] RewriteRule ^category/([^/]+)/([0-9]+)/?$ category.php/$1/$2/ [QSA,L,E=PATH_INFO:$1] RewriteRule ^category/([^/]+)/?$ category.php/$1/ [QSA,L,E=PATH_INFO:$1] RewriteRule ^post/([^/]+)/?$ read.php/$1/ [QSA,L,E=PATH_INFO:$1] RewriteRule ^tag/([^/]+)/([0-9]+)/?$ tag.php/$1/$2/ [QSA,L,E=PATH_INFO:$1] RewriteRule ^tag/([^/]+)/?$ tag.php/$1/ [QSA,L,E=PATH_INFO:$1] RewriteRule ^page/([^/]+)/?$ page.php/$1/ [QSA,L,E=PATH_INFO:$1]

bo-blog commented 7 years ago

可试试将 .htaccess 文件放置到根目录下,然后重写规则里 RewriteBase YOUR_PATH_HERE 把bW所在的路径指明。这样一般不会有问题。

dqcser commented 7 years ago

感谢大大的抽空回复,无论将代码放在主网站目录或BW目录的都不行,再尝试了一下,是不显示:No input file specified.了 却变成了404页。。。 GG了一番, 查了下空间商的参数:Server API CGI/FastCGI 是不是跟这个参数有关呢?

bo-blog commented 6 years ago

请用下面的规则:

RewriteEngine on
RewriteBase YOUR_PATH_HERE

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]

RewriteRule ^index/([0-9]+)/?$ index.php?go=/$1/ [QSA,L]
RewriteRule ^category/([^/]+)/([0-9]+)/?$ category.php?go=/$1/$2/ [QSA,L]
RewriteRule ^category/([^/]+)/?$ category.php?go=/$1/ [QSA,L]
RewriteRule ^post/([^/]+)/?$ read.php?go=/$1/ [QSA,L]
RewriteRule ^tag/([^/]+)/([0-9]+)/?$ tag.php?go=/$1/$2/ [QSA,L]
RewriteRule ^tag/([^/]+)/?$ tag.php?go=/$1/ [QSA,L]
RewriteRule ^page/([^/]+)/?$ page.php?go=/$1/ [QSA,L]