注册新账号 登录
晓木虫 返回首页

晓木虫论坛
欢迎访问晓木虫论坛

博文

通过修改配置文件.htaccess来解决discuz未上传头像时返回404

已有 3543 次阅读2019-4-27 22:53

方法一:
通过修改配置文件.htaccess来解决discuz未上传头像时返回404,当用户未上传头像时返回指定的头像,代码如下:
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} .small
RewriteRule .jpg$ https://cdn.sky.wkepu.com/xmuchong/img/noavatar_small.gif [NC,L]  
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} .middle
RewriteRule .jpg$ https://cdn.sky.wkepu.com/xmuchong/img/noavatar_middle.gif [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .jpg$ https://cdn.sky.wkepu.com/xmuchong/img/noavatar_big.gif [NC,L]
方法二:
头像调用方式改为:使用动态地址调用头像

Copyright © 2014-2025 emuchong.com All Rights Reserved. 晓木虫 保留所有权利