Php 403禁止错误 [英] Php 403 forbidden error

查看:96
本文介绍了Php 403禁止错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的服务器上重新安装我的PHP脚本时遇到了这个问题但是它出现了这个错误,就像在图片中但是经过搜索后我发现它是一个.htaccess错误或类似的东西请任何人都可以帮助它将是很好的感谢。



查看错误图片:在此处输入图片说明



图片错误



I had this problem when i've re installed my php script on my server but then it comes this error like in the picture but then after doing a search and i found it is a .htaccess error or something like that please if anyone can help it would be nice thanksss.

check picture of error: enter image description here

picture error

<pre># SERVER WISE SETTINGS
############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi

#    Action php5-cgi /cgi-bin/php5-cgi
#    AddHandler php5-cgi .php

############################################
## GoDaddy specific options

#   Options -MultiViews

## you might also need to add this line to php.ini

##  cgi.fix_pathinfo = 1
##  RewriteBase /
##  AddHandler x-httpd-php5 .php
## if it still doesn't work, rename php.ini to php5.ini

############################################
## this line is specific for 1and1 hosting

    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php


############################################
# CUSTOM SEO FRIENDLY URL REWRITING
############################################




############################################
## default index file

    DirectoryIndex index.php

############################################
## The code below should help against Local and Remote File Inclusion attacks.


RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{QUERY_STRING} (.*)(http|https|ftp):\/\/(.*)
RewriteCond %{QUERY_STRING} ^.*=(ht|f)tp\://.*$ [NC]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC]
RewriteRule .* - [F]
RewriteRule ^(.*)$ index.php [F,L]

############################################
## use URL encoding in the http:// part

    RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http%3A%2F%2F [OR]


############################################
## Adding the following directive should give you an additional layer of security 
## against this type of attacks using the proc/self/environ method.

 RewriteCond %{QUERY_STRING} proc\/self\/environ [NC,OR] 


###########################################
# disable user agent verification to not break multiple image upload

    #php_flag suhosin.session.cryptua off


############################################
# PASS THE DEFAULT CHARACTER SET
############################################

AddDefaultCharset utf-8

############################################
# DISABLE THE SERVER SIGNATURE
############################################

ServerSignature Off

############################################
# SECURE HTACCESS FILE
############################################



################################
# UPDATING TEMPLATES, JAVASCRIPT OR CSS FILE WITHOUT HITTING MOD_SECURITY.
# THIS SETTING MOSTLY HANDY WHEN YOU ARE MODIFYING TEMPLATES FROM ADMIN AREA.
################################



################################
# Disable directory browsing
################################

Options -Indexes
Options +FollowSymLinks
RewriteEngine on
IndexIgnore *

################################
# PROTECT .htaccess and .htpasswd FILES
################################



################################
# PREVENT FILE VIEWING WITH HTACCESS
################################



################################
# PPROTECT CONFIG.* FILES
################################




############################################
# DISABLING EXECUTING OF FOLLOWING FILES.
############################################

AddHandler cgi-script .pl .py .jsp .asp .jsp  .shtml .sh .cgi .pl .aspx .zip .phtml
Options -ExecCGI

############################################
## workaround for HTTP authorization
## in CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]




############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags

    #FileETag none





我的尝试:



除了



What I have tried:

replace Deny from all with Allow from all except

推荐答案

[NC]
RewriteCond%{QUERY_STRING}(\< | %3C)。* script。*(\> |%3E)[NC,OR]
RewriteCond%{QUERY_STRING} base64_encode。* \(。* \)[OR]
RewriteCond %{QUERY_STRING} GLOBALS(= | \ [| \%[0 -9A-Z] {0,2})[OR]
RewriteCond%{QUERY_STRING} [a-zA-Z0-9_] = http:// [OR]
RewriteCond%{QUERY_STRING} [ a-zA-Z0-9 _] =(\.\ .//?)+ [OR]
RewriteCond%{QUERY_STRING} _REQUEST(= | \ [| \%[0-9A-Z ] {0,2})
RewriteCond%{QUERY_STRING} [a-zA-Z0-9 _] = /([a-z0-9 _。] //?)+ [NC]
RewriteRule。 * - [F]
RewriteRule ^(。*)
[NC] RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR] RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR] RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC] RewriteRule .* - [F] RewriteRule ^(.*)


index.php [F,L]

######## ####################################
##在http:/中使用URL编码/ part

RewriteCond%{QUERY_STRING} [a-zA-Z0-9 _] = http%3A%2F%2F [OR]


### #########################################
##添加以下内容指令应该使用proc / self / environ方法为这种类型的攻击提供额外的安全层
##。

RewriteCond%{QUERY_STRING} proc\ / self\ / environ [NC,OR]


########### ################################
#禁止用户代理验证不破坏多个图片上传

#php_flag suhosin.session.cryptua off


######################### ###################
#PASS THE DEFAULT CHARACTER SET
################# ###########################

AddDefaultCharset utf-8

### ######################################### $
#DISER THE SERVER SIGNATURE
############################################ $

ServerSignature Off

################################## ##########
#SECURE HTACCESS FILE
############################ ################



################## ##############
#更新模板,JAVASCRIPT或CSS文件而不需要修改MOD_SECURITY。
#当您从管理区域修改模板时,这一切设置非常实用。
################################



################################
#禁止目录浏览
#### ############################ $

选项 - 索引
选项+关注字符串
RewriteEngine on
IndexIgnore *

################################
#PROTECT .htaccess和.htpasswd FILES
################################



################################ $
#PREVENT使用HTACCESS查看文件
################################ $



################################ $
#PPROTECT CONFIG。* FILES
################################




############################################ $
#禁止执行以下文件。
############################################ $

AddHandler cgi-script .pl .py .jsp .asp .jsp .shtml .sh .cgi .pl .aspx .zip .phtml
Options -ExecCGI

# ########################################### $
## workaround用于HTTP授权
##在CGI环境中

RewriteRule。* - [E = HTTP_AUTHORIZATION:%{HTTP:授权}]




#############################################
##如果在集群环境中运行,请取消注释这个
## http://developer.yahoo.com/performance/rules.html#etags

#FileETag none
index.php [F,L] ############################################ ## use URL encoding in the http:// part RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http%3A%2F%2F [OR] ############################################ ## Adding the following directive should give you an additional layer of security ## against this type of attacks using the proc/self/environ method. RewriteCond %{QUERY_STRING} proc\/self\/environ [NC,OR] ########################################### # disable user agent verification to not break multiple image upload #php_flag suhosin.session.cryptua off ############################################ # PASS THE DEFAULT CHARACTER SET ############################################ AddDefaultCharset utf-8 ############################################ # DISABLE THE SERVER SIGNATURE ############################################ ServerSignature Off ############################################ # SECURE HTACCESS FILE ############################################ ################################ # UPDATING TEMPLATES, JAVASCRIPT OR CSS FILE WITHOUT HITTING MOD_SECURITY. # THIS SETTING MOSTLY HANDY WHEN YOU ARE MODIFYING TEMPLATES FROM ADMIN AREA. ################################ ################################ # Disable directory browsing ################################ Options -Indexes Options +FollowSymLinks RewriteEngine on IndexIgnore * ################################ # PROTECT .htaccess and .htpasswd FILES ################################ ################################ # PREVENT FILE VIEWING WITH HTACCESS ################################ ################################ # PPROTECT CONFIG.* FILES ################################ ############################################ # DISABLING EXECUTING OF FOLLOWING FILES. ############################################ AddHandler cgi-script .pl .py .jsp .asp .jsp .shtml .sh .cgi .pl .aspx .zip .phtml Options -ExecCGI ############################################ ## workaround for HTTP authorization ## in CGI environment RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] ############################################ ## If running in cluster environment, uncomment this ## http://developer.yahoo.com/performance/rules.html#etags #FileETag none





我的尝试:



从所有人中取消拒绝除了



What I have tried:

replace Deny from all with Allow from all except

之外的所有允许

互联网上有很多线程在讨论相同的问题。这是一个 - apache - 错误消息& quot;禁止你没有权限访问/在此服务器上& quot; ; - Stack Overflow [ ^ ]。



它基本上是为目录配置的权限问题。看看吧。
There are many threads on internet discussing the same. Here is one - apache - Error message &quot;Forbidden You don&#39;t have permission to access / on this server&quot; - Stack Overflow[^].

it's basically a permission issue configured for directories. Check it out.


这篇关于Php 403禁止错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆