질문Q #13092
가상화서버 환경에서는 index.php 지우기를 하려면 httpd.conf가 아녔네요
김대영2016-03-02 16:24:30

워낙 LINUX 기본 지식이 없다보니 httpd.conf하고 .htaccess 만 계속 수정하면서 삽질만 했네요

가상화 서버에선 httpd-vhost.conf 파일안에 <Directory "/"> AllowOverride All </Directory>적용 하는 거였군요 ^^;;;

[httpd-vhost.conf]

<VirtualHost sample.domain.com:80>
    ServerAdmin webmaster@domain.com
    DocumentRoot "/samplesite/webroot"
    ServerName sample.domain.com
    ErrorLog "/var/log/httpd/sample.domain.com-error_log"
    CustomLog "/var/log/httpd/sample.domain.com-access_log" common
    <Directory "/samplesite/root/sub">
        Options Indexes FollowSymLinks
        AllowOverride All
    </Directory>
</VirtualHost>

[/samplesite/root/sub/.htaccess]

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 [QSA,L]

처음이라 쉽지 않네요

답변4
#1 한대승(불의회상) 2016-03-03 08:42:14
좋은 정보 감사 합니다. ^^
#2 kaido 2016-03-03 09:15:31
뭐든지 처음이 어렵죠 ㅎㅎ 한번 하고 나면 참 별거 아닌것을 고 몇줄 때문에 사람을 미치게 만들죠 ㅜㅜ
#3 김대영 2016-03-03 11:09:57

한대승 // 부끄럽습니다 다 아시는 건데

kaido // 미치기 전 까지 갔습니다.

#4 빛그림 2016-03-07 17:08:16

가상서버나 물리서버나 동일 합니다.

저의 경우는 httpd.conf 안에 아래와 같은 구문을 넣어주고 httpd-vhosts.conf 안에 <Directoty /> ~ </Directory>는 빼고 사용합니다. 여러개의 버추얼호스트 설정을 좀 줄이기 위함이죠. ^^

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>