2011-11-02 1 views
0

:IfModule이 작동하지 않는 것으로 보입니까? 내가 이것을 사용하는 경우

<IfModule mod_rewrite.c> 
RewriteEngine On 
RedirectMatch 301 ^/training/(.*) /faculty/training.html 
</IfModule> 

리디렉션이 발생하지 않습니다. 와 같은

는 :

<IfModule mod_rewrite> 
... 
</IfModule> 

그러나이 예상대로 작동합니다

RewriteEngine On 
RedirectMatch 301 ^/training/(.*) /faculty/training.html 

즉, 리디렉션이 <IfModule> 블록의 미세한 외부에서 작동합니다.

<IfModule>이 mod_rewrite.c를 감지하지 못하는 이유가 있습니까?

답변

2

RedirectMatch 지시문은 mod_rewrite.c이 아닌 mod_alias.c의 일부이며, IfModule에서 mod_alias.c를 확인해야합니다. RedirectMatch가 사용하지 않기 때문에 RewriteEngine을 사용할 필요가 없습니다.

+0

허. 문서에서 말하는 것처럼. 고마워, 존! – Blue

관련 문제