Thinkphp5.1项目中的验证码图片不显示,错误提示404
错误现象:
使用tp5框架的验证码时候出现了该错误
[图片]captcha
console中提示:
Failed to load resource: the server responded with a status of 404 (Not Found)
该错误是因为修改了tp5框架中pbulic
目录->.htaccess
文件中的参数,想要隐藏index.php
解决方式:(去掉问好?
,就是这么简单!)
正确代码:
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
成功演示:
——冰丫冰