2012-01-10 2 views
0

이 줄은 내 htaccess 파일에 있습니다. RewriteRule (. *) index.php 내 사이트 domain.com에 전송되는 모든 요청을 캐치합니다. 이제 하위 도메인 blog.domain.com을 만들었습니다. 내부 서버 오류가 발생합니다. htaccess에서 blog.domain.com을 예외로 추가하려면 어떻게해야합니까?하위 도메인에 대한 htacess 예외

이 내 전체 htaccess로 파일 : 어떤 도움에 감사드립니다

Options +FollowSymLinks 
RewriteEngine On 
RewriteCond %{REQUEST_URI} .*/http-bind 
RewriteRule (.*) /http-bind [L] 
RewriteCond %{REQUEST_URI} !^/index.php 
RewriteCond %{REQUEST_URI} !/ow_updates/index.php 
RewriteCond %{REQUEST_URI} !/ow_updates/ 
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.raw|/[^.]*)$ [NC] 
RewriteCond %{REQUEST_URI} !/ow_updates/ 
RewriteCond %{REQUEST_URI} !/google3ce18567a119af4.html 
RewriteRule (.*) index.php 

. 감사.

답변

0

RewriteCond 블록 상단에 다음 줄을 추가하십시오. 요청이 blog.domain.com에 대한 하지하고 현재의 모든 조건을 충족 할 때

RewriteCond %{HTTP_HOST} !^blog\.domain\.com 
RewriteCond %{REQUEST_URI} !^/index.php 
RewriteCond %{REQUEST_URI} !/ow_updates/index.php 
RewriteCond %{REQUEST_URI} !/ow_updates/ 
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.raw|/[^.]*)$ [NC] 
RewriteCond %{REQUEST_URI} !/ow_updates/ 
RewriteCond %{REQUEST_URI} !/google3ce18567a119af4.html 

에만 전달합니다.

측면에서 필자는 특정 파일 검사와 달리 다음과 같은 작업을 수행하는 것이 좋습니다.

이렇게하면 요청이 기존 파일이나 디렉토리가 아닌지 확인할 수 있습니다. 허용 목록에있는 특정 리소스 (예 : google3ce18567a119af4.html,/ow_updates/등)보다 관리하기가 쉽습니다.

+0

감사합니다. Jason. 이로 인해 문제가 해결되었습니다. – daman

관련 문제