1

에서 재 작성 줌라를 활성화 한 후 찾을 수 없음 : 이것은 내/등/아파치/사이트-가능/내 사이트입니다404 2.5 URL 내가 로컬 호스트에 내 웹 사이트의 복사본이 로컬 호스트

/var/www/vhosts/mysite.com/httpdocs 

<VirtualHost *:80> 
     ServerAdmin [email protected] 

     DocumentRoot /var/www/vhosts/mysite.com/httpdocs 
     <Directory /> 
       Options FollowSymLinks 
       AllowOverride All 
     </Directory> 
     <Directory /var/www/> 
       Options Indexes FollowSymLinks MultiViews 
       AllowOverride All 
       Order allow,deny 
       allow from all 
     </Directory> 

     ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
     <Directory "/usr/lib/cgi-bin"> 
       AllowOverride None 
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
       Order allow,deny 
       Allow from all 
     </Directory> 

     ErrorLog ${APACHE_LOG_DIR}/error.log 

     # Possible values include: debug, info, notice, warn, error, crit, 
     # alert, emerg. 
     LogLevel warn 

     CustomLog ${APACHE_LOG_DIR}/access.log combined 

    Alias /doc/ "/usr/share/doc/" 
    <Directory "/usr/share/doc/"> 
     Options Indexes MultiViews FollowSymLinks 
     AllowOverride None 
     Order deny,allow 
     Deny from all 
     Allow from 127.0.0.0/255.0.0.0 ::1/128 
    </Directory> 

</VirtualHost> 

htaccess.txt를 .htaccess로 복사했습니다. 친숙한 URL 및 URL 재 작성을 활성화하면 404 오류가 발생합니다.

나는이 작동하지 않습니다 아직 htaccess로이 라인을 주석 처리 만했습니다

Options +FollowSymLinks 
RewriteEngine On 
RewriteBase/

나는 또한 행운과

RewriteBase /mysite 

에 rewritebase을 변경했습니다.

내가 뭘 잘못하고있어?

답변

1

해결! /etc/apache2/sites-available의 여러 항목과 충돌이 있습니다. localhost에서 새 사이트를 만들 때 defaultmysite에 복사하고 mysite 파일을 수정하여 DocumentRoot를 가리 키도록합니다. 나는 이유를 정확하게 모르겠지만 나는 기본 사이트 사용하지 않으면 : 작동

sudo a2dissite default 

합니다.

어쩌면이 질문을 해결할 수는 없지만, 테스트를 거쳤기 때문에이 문제에보다 구체적인 다른 질문을 제기하는 것이 좋습니다. 다른 사이트가 활성화되어 있고 하나 이상의 RewriteEngine이 활성화되어 있기 때문입니다.

1

이 발생한 문제입니다,하지만 난 다시 작성하는 "localhost"를 잘 작동하지 않는 것을 경험 한 경우 없음 확인합니다. 호스트 파일을 변경하여 시도하십시오.

127.0.0.1  mysite.local 

그런 다음 해당 URL에 액세스하십시오.

확실하지 그 작동하지만 그것은 시도 가치가 있는지.

+0

안녕하세요. 아직 작동하지 않습니다. localhost (pure PHP)에 다른 사이트가 있고 URL 재 작성이 정상적으로 작동합니다. 어쨌든 고마워. – miquel

관련 문제