2012-08-08 7 views
0

일부 규칙을 httpd.conf 파일에 기록했습니다. 그것은 잘 작동합니다. 내가 1과 2 매개 변수와 일치해야하며 해당 일치하는 경우 리디렉션해서는 안됩니다 같은 RewriteCond를 작성하고 싶습니다.일부 RewriteCond가 일치하는 경우 리디렉션하지 않음

URL이 mobile/login 또는 mobile/admin 리디렉션이 발생하지 않아야하는 경우 어떻게해야합니까?

- 업데이트 - 여기

RewriteCond %{HTTP_USER_AGENT} "!(android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile|Nokia*| Opera*)" [NC] 
RewriteCond $1 !web 
RewriteCond $2 !login 
RewriteCond $2 !admin 
RewriteRule ^(.*)$ /web/index.php [R,L] 

$ 2 부분은 나를 위해 작동하지 않습니다.

+0

'httpd.conf' 파일의 관련 섹션을 포함 시켰을 때 도움이 될 수 있습니다. – megaflop

답변

0

RewriteRule의 패턴 시작 부분에 ! 문자를 추가하십시오.

자세한 내용은 the documentation을 참조하십시오.

업데이트

당신의 RewriteRule의 패턴이 포착 괄호 한 세트 만이 있기 때문에 $ 2 당신을 위해 작동하지 않습니다. 이것은 아마도 당신이 찾고있는 것일 것입니다 :

RewriteCond %{HTTP_USER_AGENT} "!(android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile|Nokia*| Opera*)" [NC] 
RewriteCond $1 !(web|mobile/login|mobile/admin) 
RewriteRule ^(.*)$ /web/index.php [R,L] 
+0

코드 업데이트 – Hacker

+0

내 업데이트가 도움이 되었습니까? – megaflop

관련 문제