2012-09-20 2 views
0

htaccess를 사용하여 Joomla CMS에서 "단일 논리"URL을 보호해야합니다. 어떻게 따라서 보안을 우회하는 URL 부분 주위에 교환 또는 개정 할 수 없도록 할 수 그러나.htaccess는 쿼리 문자열 조합으로 URL을 보호합니다.

RewriteEngine On 
RewriteCond %{REQUEST_URI} ^/index\.php$ 
RewriteCond %{QUERY_STRING} ^option=com_content&task=view&id=76$ 
RewriteRule ^(.*)$ /secure.htm 

: 여기 .htaccess code to protect a single URL?

특정 URL에 대한 좋은 작품이 솔루션, 발견 접속하다. 예를 들어 액세스 권한을 원하지 않습니다.

option=com_content&task=view&id=76&dummy=1 
option=com_content&id=76&task=view 

중 하나를 입력하십시오. 하지 않는 것 내가 이것을 시도

이 작동합니다 : 나는 이러한 URL 중 하나에 갈 때

RewriteEngine On 
RewriteCond %{REQUEST_URI} ^/index\.php$ 
RewriteCond %{QUERY_STRING} option=com_content 
RewriteCond %{QUERY_STRING} task=view 
RewriteCond %{QUERY_STRING} id=76 
RewriteRule ^(.*)$ /secure.htm 

답변

0

규칙 나를 위해 잘 작동 :

  • http://localhost/index.php?blah=blah&option=com_content&task=view&id=76
  • http://localhost/index.php?option=com_content&task=view&id=76&dummy=1
  • http://localhost/index.php?option=com_content&id=76&task=view
당신이 id=761

같은 것을 일치 결국하지 않도록

RewriteCond %{QUERY_STRING} (^|&)option=com_content(&|$) 
RewriteCond %{QUERY_STRING} (^|&)task=view(&|$) 
RewriteCond %{QUERY_STRING} (^|&)id=76(&|$) 

:

나는 당신은 당신의 쿼리 문자열 규칙에 사운드 경계를 추가 할 수 있습니다, 그러나 /secure.htm

의 컨텐츠를 제공받을

관련 문제