[WordPress] 403 forbidden error
2016-01-13 14:32
197 查看
本文适用于当你打开自己的WP网站时, 遇到下面的问题:
打开WP-Content 文件夹, 里面会有这个web.config 文件, 原本是不应该有的.里面的code就是禁止访问这个folder里面的所有的.php文件:
其实以.php为后缀的文件, 不管里面是什么内容, 都是按照.php来处理的.
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="SQL Injection" stopProcessing="true">
<match url="^.*\.php.*$"/>
<action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule></rules>
</rewrite>
</system.webServer>
2> Below is the solution :
Yes, it shows 403 forbidden error for some requests on your WordPress site. That is because : Due to WordPress always hacked , Our system auto detect and put a web.config file within
WP-Content to prevent request .php file in this folder.There are 2 solutions for you:
1> Use other Themes which needn't to call .php file in that way ;
2> Comment the Rewrite rule in WP-Content/web.config file. But please note that by this way , you will need to take care of your site and set the proper permission on your folders.
We always suggest you to set your WP folder permissions to read Only to prevent hacking.
3> You can login into server/your computer , touch in the web.config file in WP-content folder , set the property of this file to read-only.
.. Please remember that :
是设置文件属性为只读, 不是文件权限.
打开WP-Content 文件夹, 里面会有这个web.config 文件, 原本是不应该有的.里面的code就是禁止访问这个folder里面的所有的.php文件:
其实以.php为后缀的文件, 不管里面是什么内容, 都是按照.php来处理的.
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="SQL Injection" stopProcessing="true">
<match url="^.*\.php.*$"/>
<action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule></rules>
</rewrite>
</system.webServer>
2> Below is the solution :
Yes, it shows 403 forbidden error for some requests on your WordPress site. That is because : Due to WordPress always hacked , Our system auto detect and put a web.config file within
WP-Content to prevent request .php file in this folder.There are 2 solutions for you:
1> Use other Themes which needn't to call .php file in that way ;
2> Comment the Rewrite rule in WP-Content/web.config file. But please note that by this way , you will need to take care of your site and set the proper permission on your folders.
We always suggest you to set your WP folder permissions to read Only to prevent hacking.
3> You can login into server/your computer , touch in the web.config file in WP-content folder , set the property of this file to read-only.
.. Please remember that :
是设置文件属性为只读, 不是文件权限.
相关文章推荐
- wordpress rewrite问题解决
- WordPress升级版本及安装插件出现”Problem with the SSL CA cert”的解决办法
- 详解WordPress中添加和执行动作的函数使用方法
- 优化WordPress的Google字体以加速国内服务器上的运行
- 在WordPress中使用PHP脚本来判断访客来自什么国家
- 使用WordPress发送电子邮件的相关PHP函数用法解析
- 推荐十款免费 WordPress 插件
- 在Linux系统下一键重新安装WordPress的脚本示例
- WordPress中Gravatar头像缓存到本地及相关优化的技巧
- Wordpress 忘记密码的处理方法
- 关于WordPress的SEO优化相关的一些PHP页面脚本技巧
- WordPress中创建用户角色的相关PHP函数使用详解
- 讲解WordPress开发中一些常用的debug技巧
- 编写PHP脚本来实现WordPress中评论分页的功能
- 优化WordPress中文章与评论的时间显示
- 解析WordPress中的post_class与get_post_class函数
- 详解WordPress开发中的get_post与get_posts函数使用
- 在WordPress中使用wp_count_posts函数来统计文章数量
- WordPress中用于获取搜索表单的PHP函数使用解析
- 调试WordPress中定时任务的相关PHP脚本示例