| 제목 | 주소창에 index.php 제거 | ||
|---|---|---|---|
| 글쓴이 | 우리모 | 작성시각 | 2012/08/02 16:57:03 |
|
|
|||
|
안녕하세요. 서버 이전을 하면서 처음부터 다시 세팅하고 있습니다. 일단 포럼에 있는 내용대로 config.php 파일의 index.php 를 공백으로 두었구요. .htaccess 파일을 수정했지만 도메인.phps.kr/login 을 접속하면 404 에러가 발생하고, 도메인.phps.kr/index.php/login 을 접속하면 화면이 나옵니다. 도메인.phps.kr/login 을 접속하면 화면이 나옵니다. (route.php 수정해서 login으로 수정함) CI 1.7.3 에서 CI 2.1.2 로 변경하고, 기존 서버스팩을 4.x 대에서 5.x 대로 바꿔서 올렸습니다. 뭐가 잘못된걸까요??
# 예전소스
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|css|.+\.gif$|.+\.jpg$|.+\.png$|.+\.js$)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /tms/index.php/$1 [L]
# 지금소스
#==========================================================================
# php flag
PHP_FLAG register_globals OFF
#================= sub domain rule start =================
RewriteEngine On
#Internal Redirection Loop stop
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]
#================= access rule start =================
#RewriteCond %{HTTP_REFERER} !^$
#RewriteCond %{HTTP_REFERER} !^http(s)?://test\.phps\.kr [NC]
#RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?test\.com [NC]
#RewriteRule .*\.(index\.php|jpe?g|gif|png|swf|flv)$ - [NC,F]
#================== access rule end ==================
#===== exception start =====
# tld
RewriteCond %{HTTP_HOST} !^([a-z0-9-]+)\.([a-z]{2,})$ [NC]
RewriteCond %{HTTP_HOST} !^([a-z0-9-]+)\.co\.([a-z]{2,})$ [NC]
# kr domain
RewriteCond %{HTTP_HOST} !^([a-z0-9-]+)\.(xn--3e0b707e)$ [NC]
RewriteCond %{HTTP_HOST} !^([a-z0-9-]+)\.([a-z]{2,})\.(kr)$ [NC]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} !\.phps\.kr$ [NC]
#====== exception end ======
# host check & rewrite
RewriteCond %{HTTP_HOST} ^([a-z0-9-]+)\. [NC]
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/%1/$1 [L]
#================== sub domain rule end ==================
#==========================================================================
|
|||
| 다음글 | mysql_set_charset 와 같은 구문 (2) | ||
| 이전글 | 서버 환경 변경에 따른 질문이요 (14) | ||
|
변종원(웅파)
/
2012/08/02 17:57:53 /
추천
0
|
|
우리모
/
2012/08/03 14:06:40 /
추천
0
웅파님
매번 감사합니다. 웹호스팅을 받고 있어서 문의 했더니 .htaccess 내용은 아무렇게나 바꿔도 상관 없다 하여 저 내용 지우고 아래와 같이 바꿔서 해결했습니다. 웹호스팅은 phps.kr 입니다.
PHP_FLAG register_globals OFF
RewriteEngine On
RewriteCond $1 !^(index\.php|images|captcha|data|include|uploads|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L] |
AllowOverride None 설정도 All로 되어있는지 보세요