2013-08-29 2 views
0

난 stackoverflow 웹 사이트를 통해 찾고 있었고 내 질문에 대한 답변을 찾을 수 없습니다.우분투 htaccess 문제

apache2를 설치하면 기본적으로 웹 루트가/var/www /입니다./var/www/test /라는 새로운 webspace를 만들면 .htaccess 파일이 입력되지 않으면 작동하지 않습니다. . default.conf 파일에 추가하고 파일을 다시로드하려고 시도했지만 여전히 작동하지 않습니다. 아무도 조언 해 줄 수 있니?

내 아파치 설정 파일은 다음과 같습니다 :

<VirtualHost *:80> 
    # The ServerName directive sets the request scheme, hostname and port that 
    # the server uses to identify itself. This is used when creating 
    # redirection URLs. In the context of virtual hosts, the ServerName 
    # specifies what hostname must appear in the request's Host: header to 
    # match this virtual host. For the default virtual host (this file) this 
    # value is not decisive as it is used as a last resort host regardless. 
    # However, you must set it for any further virtual host explicitly. 
    #ServerName www.example.com 

    ServerAdmin [email protected] 
    DocumentRoot /var/www 

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 
    # error, crit, alert, emerg. 
    # It is also possible to configure the loglevel for particular 
    # modules, e.g. 
    #LogLevel info ssl:warn 

    ErrorLog ${APACHE_LOG_DIR}/error.log 
    CustomLog ${APACHE_LOG_DIR}/access.log combined 

    # For most configuration files from conf-available/, which are 
    # enabled or disabled at a global level, it is possible to 
    # include a line for only one particular virtual host. For example the 
    # following line enables the CGI configuration for this host only 
    # after it has been globally disabled with "a2disconf". 
    #Include conf-available/serve-cgi-bin.conf 
</VirtualHost> 

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet 

사람이 어떤 조언을 제공 할 수 있습니다?

답변

0

Apache 구성 파일 (이 기본값은 /etc/apache2/sites-available/default)에이 줄이 있습니까? 그래서, 당신은 당신의 .htaccess 파일에 필요한 기능을 포함하도록 변경하는 경우

AllowOverride None 

합니다 (AllowOverride documentation 참조).

AllowOverride AuthConfig FileInfo ... 

또한 .htaccess 파일에 문제가있을 수 있습니다. 예를 들어, 당신은 :

<IfModule mod_rewrite.c> 

mod_rewrite 실제로 활성화되어 있습니까? 그렇지 않다면, 그렇게해야합니다.

당신은 당신이 또한 시도했다 : 당신이 실제로 브라우저에서 /index.html에 가면

Redirect /index.html mynewwebsite.com/foldername 

이는 아무것도 할 것입니다.

+0

위의 파일이 내 htaccess 파일 전체에 해당하지 않는 이유는 AllowOverride와 관련이 없습니다. 없음 또는 개별 웹 공간 –

+0

위의 내용과 같이 '.htaccess' 파일이 보이지 않아야합니다. 여러분이 게시 한 것은 아파치 서버 설정 파일과 유사합니다.이 파일은'/ etc/apache2/sites-enabled'에 있으며'/ etc/apache2/sites-available'에 링크되어 특정 웹 사이트를 가능하게합니다. 그러나'.htaccess' 파일은 웹 사이트의 * 개별 폴더 *에 존재하며 그 폴더와 관련된 옵션을 지정합니다. * VirtualHost 또는 로깅 지시문이 아닙니다. – jnylen

+0

네, 죄송합니다. 내가 아파치 conf 파일 (위 게시) 어떤 AllowOverride 없음 또는 모든 조언을 갖고 있지 않는 것 같아서 말하는 것을 사과? –