2016-11-17 4 views
1

Symfony 2.8/Sonata 프로젝트에서 작업 중이며, 모든 URL이 "/index.php"와 중복되고 다른 URL이 중복 된 것으로 나타났습니다. 그래서 URL : '나는 그것을 제거의 .htaccess를 사용하려고urata에서 /index.php를 제거하십시오.

http://mydomaine.com/test/test.html

, 그러나 didn를 :

http://mydomaine.com/index.php/test/test.html

가로 리디렉션됩니다 일 :

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 
    RewriteRule ^(.*)$ app_dev.php [QSA,L] 
</IfModule> 

의견이 있으십니까? 감사

+0

내 작품 :) 아니다, 메신저는 –

답변

1

장소의 URL에서 index.php을 제거하는 단지 RewriteEngine On 아래이 규칙 :

RewriteCond %{THE_REQUEST} /index\.php [NC] 
RewriteRule ^index\.php(/.+)$ $1 [L,R=301,NE] 
+0

감사를 /index.php 숨기려고하지만, 아무것도 변경되었습니다! –

+0

브라우저에 어떤 URL을 입력하셨습니까? – anubhava

+0

http://mydomaine.com/index.php/test/test.html, 리다이렉션이 없습니다 –