2010-07-08 6 views
0

내 htaccess 파일에서 내 ErrorDocument 404 문이 index.php로 리디렉션되지 않습니다. 대신 정규 404 오류가 발생합니다. 이것은 정기적 인 아파치 설치입니다.404 리디렉션이 작동하지 않습니다.

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/

    #Removes access to the system folder by users. 
    #Additionally this will allow you to create a System.php controller, 
    #previously this would not have been possible. 
    #'system' can be replaced if you have renamed your system folder. 
    RewriteCond %{REQUEST_URI} ^system.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 

    #Checks to see if the user is attempting to access a valid file, 
    #such as an image or css document, if this isn't true it sends the 
    #request to index.php 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule> 

<IfModule !mod_rewrite.c> 
    # If we don't have mod_rewrite installed, all 404's 
    # can be sent to index.php, and everything works as normal. 
    # Submitted by: ElliotHaughin 

    ErrorDocument 404 /index.php 
</IfModule> 
+0

불쌍한 당신! 나는 당신이 이것을 소트하게되기를 정말로 바란다. –

+0

이것을 테스트하기 위해 어떤 브라우저를 사용하고 있는가? – Sjoerd

+0

mod_rewrite가 활성화되어 있는지 알고 계십니까? (echo phpinfo()로 확인할 수 있습니다)? 또한 "일반 404"는 무엇을 의미합니까? 아파치 404 또는 CI를 의미합니까? –

답변

0

나는 그것을 분류했다. 나는 코드 이그니 터 (Code Igniter)에서 라우터를 다루는 커스텀 에러를 가지고 가서 .htaccess 파일을 건너 뛰었다. 클라이언트 서버에 직접 액세스 할 필요가 없기 때문에 직접 변경 한 다음 CI에 대한 표준 .htaccess 파일을 제공했습니다. 방금 그 길을가는 것이 내 인생을 더 단순하게 만들었습니다.

0

여기에서 자세한 정보가 필요합니다. CodeIgniter 404 또는 Apache 404를 사용하고 있습니까?

CodeIgniter 404를 사용 중이라면 예상대로 작동합니다.

+0

아파치의 404가 발생했습니다 –

+0

/index.php로 리디렉션하고 있지만 index.php가있는 곳이 어디입니까? 문서 루트에? 또는 하위 폴더에서 작업하고 있습니까? – Zack

관련 문제