mod_rewrite 에 대한 질문입니다. 않되네요...
<VirtualHost 211.233.37.57>
DocumentRoot /usr/local/apache/htdocs
ServerName clubmo.com
</VirtualHost>
NameVirtualHost 211.233.37.57
<VirtualHost 211.233.37.57>
ServerAdmin info@clubmo.co.kr
DocumentRoot /home/hobby/public_html
ServerName hobby.clubmo.com
ErrorLog logs/hobby_clubmo-error_log
CustomLog logs/hobby_clubmo-access_log common
</VirtualHost>
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#
<VirtualHost 211.233.37.57>
ServerAdmin info@clubmo.co.kr
ServerName *.linkmo.co.kr
DocumentRoot /home/linkmo/public_html/
DirectoryIndex index.php index.html index.htm
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
RewriteEngine On
# for Debug
# RewriteLog "/home/asp/public_html/rewrite.log"
# RewriteLogLevel 9
RewriteRule ^/cgi-bin(/.*)$ /cgi-bin$1 [L,PT]
RewriteRule ^(.*) %{HTTP_HOST}$1
RewriteCond /home/asp/public_html/%{HTTP_HOST} -d
RewriteRule ^(.+) /home/asp/public_html/$1 [s=4,E=VIRTUAL_DO
CUMENT_ROOT:/home/asp/public_html/%{HTTP_HOST}/]
RewriteCond /home/asp/public_html/www.%{HTTP_HOST} -d
RewriteRule ^(.*) http://www.$1
[L,R]
RewriteCond %{HTTP_HOST} !^www\..+$
RewriteCond /home/asp/public_html/www.$2 -d
RewriteRule ^([^.]+.)([^/]+)(.+)$ http://www.$2$3
[L,R]
RewriteCond /home/asp/public_html/$2 -d
RewriteRule ^([^.]+.)([^/]+)(.+)$ http://$2$3
[L,R]
RewriteRule ^([^/]+/)(.*) %{DOCUMENT_ROOT}$2
[s=1]
RewriteCond $1$2 ^.*[^/]$
RewriteCond $1$2 -d
RewriteRule ^(/home/asp/public_html/)(.+[^/])$ http://$2/
[L,R]
RewriteCond $1$2 ^.*[^/]$
RewriteCond $1$2 -d
RewriteRule ^(/home/linkmo/public_html/)(.+[^/])$ http://%{HTT
P_HOST}/$2/ [L,R]
HostNameLookups off
</VirtualHost>
상단처럼 httpd.conf 를 세팅하였습니다..
mod_rewrite 의 세팅은 지리스 님의 세팅법을 보고 배낀거거덩요!~
(지리스님 감사합니다.... 헤헤헤...)
근데 아파치를 리스타팅을 아래 처럼 해보니...
[root@www bin]# ./apachectl restart
./apachectl restart: configuration broken, ignoring restart
./apachectl restart: (run 'apachectl configtest' for details)
요런 메세지가 떠서요
[root@www bin]# ./apachectl configtest
Syntax error on line 969 of /usr/local/apache/conf/httpd.conf:
Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not
included in the server configuration
요런 메세지가 뜨네요....
rewrite 모듈을 사용하려면 또 다른 세팅이 필요 한건가요??
에러내용은 mod_rewrite때문에 발생한게 아닌것 같아보입니다.h
에러내용은 mod_rewrite때문에 발생한게 아닌것 같아보입니다.
httpd.conf 52라인에 무엇이 있는지 모르겠는데 아마 ServerType이라는 항목 같은데
그부분이 문제인것 같네요.
------------------------------
좋은 하루 되세요.
댓글 달기