codeigniter index.php 없애기(3가지)
codeigniter index.php 없애기
1. /application/config.php
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = ''; <= index.php 있다면 제거
2. .htaccess 파일 설정
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond $1 !^(index\.php|css|js|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
3. 아파치 virtual-host 설정 ( 디렉토리 보안설정)
/usr/local/apache/conf/extra/httpd-vhosts.conf 파일 아래 내용 필수
시스템 설정 보호하기
정말로 안전한 서버를 운영하려면 사용자가 .htaccess 파일을 사용하여 당신이 설정한 보안기능을 변경하길 바라지 않을 것이다. 그러기위해 다음과 같은 방법이 있다.
서버 설정파일에 다음을 추가한다
<Directory />
AllowOverride None
</Directory>
아파치 보안팁 정보입니다.
링크https://httpd.apache.org/docs/2.2/ko/misc/security_tips.html