CI 묻고 답하기

제목 CI + Smarty로 개발설정을 하고싶습니다.
카테고리 CI 2, 3
글쓴이 GridView 작성시각 2019/05/07 11:51:20
댓글 : 1 추천 : 0 스크랩 : 0 조회수 : 10949   RSS

안녕하세요 

처음 CI + Smarty로 개발 설정 해보고 있는 초보 개발자입니다.

 

환경

nginx version: nginx/1.10.2

CI version : 1.7.2

 

 

위처럼 설정을하였고 Router는 시작 controller를 main으로 해서 

메인화면은 출력을하였습니다. (http://domain/app/)

 

그런데 다음 URL이동할때 (http://domain/app/member/)를 입력했을경우에 

memeber.php에 index로 이동을 하고싶은데 계속 메인만 뜹니다 (URL설정이 잘못된거같기도하고 .. nginx설정이 이상한거같기도하고 ..)

다음 URL이동하기위한 설정 방법이 궁금합니다. ㅠㅠ 

 

 

아래는 제거 설정한 nginx 설정입니다.

server {
    server_name www.domain.co.kr;

    set $home "/app/www_new/";

        root   $home;
        index  index.php index.html index.htm;

        location / {
                rewrite ^/$ /app/    redirect;
        }

        location /app {
                rewrite ^/app/(.+)$ /app/index.php/$1 last;
        }

        location ~ \.php($|/) {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_connect_timeout 300s;
                fastcgi_send_timeout 300s;
                fastcgi_read_timeout 300s;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

        location /head/ {
                rewrite ^/head/application/views(.+)$ /head/application/views$1 break;
                rewrite ^/head/share(.+)$ /head/share$1 break;
                rewrite ^/head/(.+)$ /head/index.php/$1 last;
        }

        location ~* \.(gif|jpg|jpeg|png|js|css|swf|ico)  {
                rewrite ^(/skin/.*) /front$1 break;
                expires 30d;
        }

        location ~ ^/skin/.*\.(gif|jpg|jpeg|png|js|css|swf|ico) {
                expires max;
                rewrite ^(/skin/.*)$ /front$1 redirect;
        }
        location ~ ^/images/.*\.(gif|jpg|jpeg|png|js|css|swf|ico) {
                expires max;
        }

    #listen 80;
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/www.domain.co.kr/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/www.domain.co.kr/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

 

조언 부탁드립니다 ㅠㅠ 

 

*참고*

root : www_root 이고

아래로 /app/과 /head/로 나눠서 프론트 , 백 두가지를 사용하려합니다. 

ci파일은 app과 head에 각각 들어가있습니다.

 다음글 스쿨호스팅에서 404에러 발생. (5)
 이전글 Update에 대한 $this->db->af... (2)

댓글

GridView / 2019/05/07 15:52:23 / 추천 0
아래 코드들의 정확한 차이는 모르겠으나 

PATH_INFO로 해두었다가 

REQUEST_URI로 변경을 했더니 잘되네요 ㅠㅠㅠㅠ 

 
| 'AUTO' Default - auto detects
| 'PATH_INFO' Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI' Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = "REQUEST_URI";