CI 묻고 답하기

제목 초보자 질문 - index.php 제거하는데 문제가 있어 물어봅니다.
글쓴이 kazu77 작성시각 2015/01/13 15:07:58
댓글 : 3 추천 : 0 스크랩 : 0 조회수 : 18592   RSS
/application/config/config.php    
$config['index_page'] = '';

http://bootstrap.beanpo.co.kr/

컨트롤러 웰컴에 이렇게 했는데

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
    function index(){
        $this->load->view('head');
        $this->load->view('main');
        $this->load->view('footer');
    }
    function get($id){
  $this->load->view('head');
  $this->load->view('get',array('id' =>$id));
  $this->load->view('footer');
    }
}
?>
인덱스는 잘나오는데


http://bootstrap.beanpo.co.kr/index.php/login 잘되는데
http://bootstrap.beanpo.co.kr/login 이건안되네요.

왜그럴까요?
 
 다음글 CI 에서는 SQL문 처리 실패시 던저주는게 없나요?? (8)
 이전글 [ODBC] 다른 hstmt의 결과에 연결이 사용 중... (1)

댓글

kazu77 / 2015/01/13 15:12:01 / 추천 0
시스템폴더

.htaccess
 
<IfModule mod_rewrite.c>
 
    RewriteEngine On
    RewriteBase /
 
    ### Canonicalize codeigniter URLs
 
    # If your default controller is something other than
    # "welcome" you should probably change this
    RewriteRule ^(welcome(/index)?|index(\.php)?)/?$ / [L,R=301]
    RewriteRule ^(.*)/index/?$ $1 [L,R=301]
 
    # Removes trailing slashes (prevents SEO duplicate content issues)
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)/$ $1 [L,R=301]
 
    # Enforce www
    # If you have subdomains, you can add them to 
    # the list using the "|" (OR) regex operator
    RewriteCond %{HTTP_HOST} !^(www|subdomain) [NC]
    RewriteRule ^(.*)$ http://www.domain.tld/$1 [L,R=301]
 
    # Enforce NO www
    #RewriteCond %{HTTP_HOST} ^www [NC]
    #RewriteRule ^(.*)$ http://domain.tld/$1 [L,R=301]
 
    ###
 
    # 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>
 
    # Without mod_rewrite, route 404's to the front controller
    ErrorDocument 404 /index.php
 
</IfModule>

이렇게 했구요
변종원(웅파) / 2015/01/13 16:15:47 / 추천 0
어떤걸 참고하셔서 어떻게 했는지 모르기 때문에 참고링크 알려드립니다.
순서대로 적용하고 체크해보세요.
http://cikorea.net/lecture/view/213/page/1/
kazu77 / 2015/01/20 16:03:58 / 추천 0
네 감사합니다 . 루트에 ht..파일넣으니 되더라구요 감사합니다. 웅파님