하루 종일이 작업을하고 있으며 제대로 작동하지 않습니다. 나는 htaccess로 파일을 다음과 생성 10월 CMS를 사용하고 있습니다 : 나는 또한/양식/디렉토리에있는 contact.php 파일을 가지고 .htaccess에 화이트리스트 PHP 스크립트가 있습니다.
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteRule ^(form/contact.php)($|/) - [L]
##
## You may need to uncomment the following line for some hosting environments,
## if you have installed to a subdirectory, enter the name here also.
##
# RewriteBase/
##
## Black listed folders
##
RewriteRule ^bootstrap/.* index.php [L,NC]
RewriteRule ^config/.* index.php [L,NC]
RewriteRule ^vendor/.* index.php [L,NC]
RewriteRule ^storage/cms/.* index.php [L,NC]
RewriteRule ^storage/logs/.* index.php [L,NC]
RewriteRule ^storage/framework/.* index.php [L,NC]
RewriteRule ^storage/temp/protected/.* index.php [L,NC]
RewriteRule ^storage/app/uploads/protected/.* index.php [L,NC]
##
## White listed folders
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !/storage/app/uploads/.*
RewriteCond %{REQUEST_FILENAME} !/storage/app/media/.*
RewriteCond %{REQUEST_FILENAME} !/storage/temp/public/.*
RewriteCond %{REQUEST_FILENAME} !/form/.*
RewriteCond %{REQUEST_FILENAME} !/themes/.*/(assets|resources)/.*
RewriteCond %{REQUEST_FILENAME} !/plugins/.*/(assets|resources)/.*
RewriteCond %{REQUEST_FILENAME} !/modules/.*/(assets|resources)/.*
RewriteCond !^index.php index.php [L,NC]
RewriteCond %{REQUEST_FILENAME} !/new/.*
##
## Block all PHP files, except index
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteRule !^index.php index.php [L,NC]
##RewriteCond %{REQUEST_FILENAME} -f
##RewriteCond %{REQUEST_FILENAME} \.php$
##RewriteRule !^contact.php contact.php [L,NC]
##
## Standard routes
##
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
. 내가 원한 것은 POST를 사용할 때 contact.php가 실행되도록 허용하는 것이다. WordPress 또는 joomla로 나는 그런 문제를 만나지 않았다. 또한 htaccess를 배우기위한 좋은 자습서가 있습니까?
이 주셔서 감사합니다 제목 섹션으로 시간, 불행히도 그것은 작동하지 않는 것 같습니다 - 나는 직접 브라우저 또는 게시판에서 연락 양식으로 이동하려고 할 때 여전히 403 오류가 발생합니다./ – engray
그리고 "##를 제외한 모든 PHP 파일을 차단하십시오."라는 명령을 제거하면 작동합니까? – Fanda36
또는 ## 앞에 모든 PHP 파일을 차단하십시오 (색인 제외)) : – Fanda36