2013-04-15 4 views
0

내 htaccess로 파일이했습니다가 :htaccess로하고 재 작성 규칙

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /test/ 
RewriteCond %{REQUEST_URI} !(panel/index.php) 
RewriteRule ^panel/(.*)$ panel/index.php/$1/ [L] 
</IfModule> 

나는 터널을 제어하기위한 panel/index.phppanel/(.*) 포함 된 모든 링크를합니다.

위의 규칙은 URL이 http://localhost/test/panel/ 인 경우를 제외하고는 작동합니다! 이 리디렉션 것을 :

http://localhost/test/panel/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/

필요로하는 데 도움이됩니다.

+0

가 왜'index.php' 디렉토리로이를 치료하는 시도? rewrite patern이 실제로'index.php'가 호출되도록'RewriteRule^panel /(.*)$ panel/index.php? q = $ 1 [L, QSA]'와 같은 것이어야합니다. –

+0

@ G-Nugget 내가 해냈어. 그러나 결과는 같습니다. – revo

+0

그래서 실제로'index.php'를 실행하지 않아야합니까? –

답변

1

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    #skip rewrite for index.php 
    RewriteRule ^panel/index.php(.*)$ - [S=1,L] 
    RewriteRule ^panel/(.*)$ panel/index.php/$1/ [L] 
</IfModule> 
+0

같은 결과! – revo

+0

테스트가 저에게 맞습니다. –

+0

테스트가 작동하지 않습니다. 루트 디렉토리는'test'이고,'panel'은 서브 디렉토리입니다. .htaccess는 루트에 놓입니다. 이 시나리오는 나를 위해 작동하지 않습니다, – revo