亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

帶有自動前置 + ErrorDocument + 選項的 .htaccess 文件中的錯誤

帶有自動前置 + ErrorDocument + 選項的 .htaccess 文件中的錯誤

PHP
Qyouu 2021-06-01 09:35:07
我有這個.htaccess:Options -IndexesErrorDocument 403 /server/403.phpphp_value auto_prepend_file "./server/conferror.php"但它向我發送了這個錯誤:警告:未知:無法打開流:第 0 行的未知中沒有此類文件或目錄致命錯誤:未知:在第 0 行的未知中打開所需的 './server/conferror.php' (include_path='C:\xampp\php\PEAR') 失敗如果我刪除ErrorDocument線它工作得很好。如果我設置ErrorDocument并刪除Options行它工作正常但不阻止目錄導航...此文件是 php 錯誤的處理程序,需要通過 .htaccess php_value auto_prepend_file "./server/conferror.php"我如何才能.htaccess防止導航目錄和輸出同時文件ErrorDocument并保留前置文件。
查看完整描述

1 回答

?
青春有我

TA貢獻1784條經驗 獲得超8個贊

用這個代碼解決:


# Control de Errores

php_value auto_prepend_file "server/conferror.php"

# Disable directory browsing 

Options -Indexes

# Hide the contents of directories

IndexIgnore *

# Hide files of type .png, .zip, .jpg, .gif and .doc from listing

IndexIgnore *.png *.zip *.jpg *.gif *.doc *.pdf *.txt *.jpeg *.log

# Allow access to php files

<Files *.log>

    deny from all

</Files>

<Files *.php>

    Order Deny,Allow

    Deny from all

    Allow from 127.0.0.1

</Files>

<Files index.php>

    Order Allow,Deny

    Allow from all

</Files>

<Files signal.php>

    Order Allow,Deny

    Allow from all

</Files>

# Mal Request

ErrorDocument 400 server/400.html

# No Autorizado

ErrorDocument 401 server/401.html

# Acceso Prohibido

ErrorDocument 403 server/403.html

# No Encontrada

ErrorDocument 404 server/404.html

# Error interno del Servidor

ErrorDocument 500 server/500.html


查看完整回答
反對 回復 2021-06-04
  • 1 回答
  • 0 關注
  • 218 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號