2012-02-12 5 views
0

나는 codeIgniter 응용 프로그램을 만들었습니다. 그것의 작동 오, 그래서 내 지역에 멋지지만, 내가 메인에 배포하면 모든 내 페이지가 홈 페이지로 리디렉션되고 있습니다. .CodeIgniter 모든 페이지가 홈 페이지로 리디렉션됩니까?

--- www가

----- htaccess로

------ CodeIgniter를 (응용 프로그램이 여기에 살고) :

나는 다음과 같은 디렉토리 구조를 가지고있다.

RewriteEngine on 
RewriteCond $1 ^media 
RewriteRule ^(.*)$ codeIgnite/$1 

RewriteCond $1 !^(index\.php|codeIgnite|images|robots\.txt) 
RewriteRule ^(.*)$ codeIgnite/index.php/$1 

을 다음과 같이

내 htaccess로가 본 내 config.php를 $config['base_url'] = "http://localhost/codeIgnite/"; // 또는 그냥 http://localhost/을해야 하는가?

변경할 필요가있는 다른 설정이 있습니까? 도와주세요.

내 홈페이지가 잘 보입니다. 다른 페이지에 문제가 있습니다. 내가 제공 한 URL에 관계없이 홈 페이지 UI가 표시됩니다.

+0

'localhost'를 도메인 이름으로 바꾸십시오. –

+0

base_url 설정 항목이 실제 따옴표로되어 있다고 알려주십시오 : P – Joe

+0

안녕하세요, Muhammad. 벌써 했어. 나는/codeIgnite를 가져야하는지, 아니면 도메인 이름을 가지고 있어야하는지 궁금합니다. 또한 그것의 https 서버, 그래서 나는 https 또는 http를 추가해야합니까? – Sharad

답변

3

$ config [ 'uri_protocol'] = "ORIG_PATH_INFO"를 설정하면 문제가 해결되었습니다.

+0

미래의 방문객에게 도움이되도록 허용 된 대답으로 표시해주세요. –

+0

나는 그것을 할 것이다. 그러나 나는 그것을 위해 이틀 동안 기다려야한다. (진드기를 클릭하는 것은 thats이다.). – Sharad

+0

나는 돌아와서 당신 자신의 질문에 답하는 것에 대해 많이 감사하다는 말을 남겨야한다. . 다른 사람의 고대 codeigniter 설치와 씨름하는 3 일은 너에게 감사하고있다. – Victoria

1

나는 제공된 .htaccess from CodeIgniter을 사용하고 제대로 작동하려면 RewriteBase을 내 하위 디렉토리로 설정했습니다.

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase /codeIgnite/ 

    #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] 

    #When your application folder isn't in the system folder 
    #This snippet prevents user access to the application folder 
    #Submitted by: Fabdrol 
    #Rename 'application' to your applications folder name. 
    RewriteCond %{REQUEST_URI} ^application.* 
    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

codeIgnite 폴더 외부에 몇 개의 폴더를 병렬로 배치하려고합니다. 예 : RewriteCond $ 1!^(index \ .php | codeIgnite | images | robots \ .txt) – Sharad

+0

codeigniter 응용 프로그램에서 해당 폴더를 사용하고 있습니까? CI 폴더의 루트에 .htaccess를 만들 수 없습니까? –

+0

해당 폴더는 내 CodeIgnite 응용 프로그램에서 사용되지 않습니다. 그들은 다른 페이지를 포함하고 있습니다. 내 기본 가정에서 codeIgniter 응용 프로그램을 원하지만 다른 페이지는 각 경로와 마찬가지로 액세스 가능해야합니다. – Sharad

0

당신은 CodeIgniter의 폴더에 htaccess로 넣어 있어야하며 또한이 한다 RewriteRule^(. ) $ /codeIgniter/index.php/$1 또는 한다 RewriteRule에 파일의 마지막 줄을 수정해야^(.) $ /codeIgnite/index.php/$1 아파치에서 아무것도하지 않아도됩니다. 설정은 오직 rewrite_module 확장을 켜십시오.

관련 문제