Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 禁止你';使用嵌入的pdf保存网页时,您无权访问此资源错误_Apache_.htaccess - Fatal编程技术网

Apache 禁止你';使用嵌入的pdf保存网页时,您无权访问此资源错误

Apache 禁止你';使用嵌入的pdf保存网页时,您无权访问此资源错误,apache,.htaccess,Apache,.htaccess,网站是禅车。试图添加 <embed src="pdf/timetable.pdf" height="1000" width="900"></embed> 然后在admin目录中,有另一个htaccess文件包含 DirectoryIndex index.php # deny *everything* <FilesMatch ".*\..*"> Order Allow,Deny Deny from all </FilesMatch> # but

网站是禅车。试图添加

<embed src="pdf/timetable.pdf" height="1000" width="900"></embed>
然后在admin目录中,有另一个htaccess文件包含

DirectoryIndex index.php
# deny *everything*
<FilesMatch ".*\..*">
Order Allow,Deny
Deny from all
</FilesMatch>

# but now allow just *certain* necessary files:
<FilesMatch "(^$|^favicon.ico$|.*\.(php|js|css|jpg|gif|png|pdf)$)">
Order Allow,Deny
Allow from all
</FilesMatch>

IndexIgnore */*

# The following makes adjustments to the SSL protocol for    Internet Explorer browsers
<IfModule mod_setenvif.c>
<IfDefine SSL>
SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
</IfDefine>
</IfModule>

#turn off X-PHP-Originating-Script header when sending emails from admin
#uncomment to activate:
# php_flag mail.add_x_header Off
DirectoryIndex.php
#否认一切*
命令允许,拒绝
全盘否定
#但现在只允许*某些*必要的文件:
命令允许,拒绝
通融
IndexIgnore*/*
#下面对Internet Explorer浏览器的SSL协议进行了调整
SetEnvIf用户代理“*MSIE.*”\
nokeepalive ssl不干净关闭\
降级-1.0力响应-1.0
#从管理员发送电子邮件时关闭X-PHP-origing-Script标题
#取消注释以激活:
#php_flag mail.add_x_header Off

有人能告诉我这里可能有什么问题吗?我是否需要向htaccess文件中添加其他内容,或者我的主机是否需要在apache配置中更改某些内容?

您从日志中引用的内容听起来似乎不是错误的真正原因,只是配置的403错误文档无法访问,所以这应该是由原始文档导致的错误,但不是原因。由于您只有在尝试保存特定内容时才会看到这一点,因此我的第一个猜测是,这可能与XSS保护有关——虽然不确定,但如果这确实体现在403中,我认为这是客户端的事情。尽管如此,我还是会尝试如果显式禁用它会改变一些事情,如果这没有帮助,那么我会从启用重写日志开始(注意日志级别,这会产生很多信息),以查看内部在这方面到底发生了什么。
DirectoryIndex index.php
# deny *everything*
<FilesMatch ".*\..*">
Order Allow,Deny
Deny from all
</FilesMatch>

# but now allow just *certain* necessary files:
<FilesMatch "(^$|^favicon.ico$|.*\.(php|js|css|jpg|gif|png|pdf)$)">
Order Allow,Deny
Allow from all
</FilesMatch>

IndexIgnore */*

# The following makes adjustments to the SSL protocol for    Internet Explorer browsers
<IfModule mod_setenvif.c>
<IfDefine SSL>
SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
</IfDefine>
</IfModule>

#turn off X-PHP-Originating-Script header when sending emails from admin
#uncomment to activate:
# php_flag mail.add_x_header Off