2017-04-27 2 views
0

로컬 Apache 서버에 가상 호스트를 정의했습니다. 제대로 작동하고 /backend/web/index.php에 의해 처리 http://florist/admin가상 호스트에서 앨리어스가 올바르지 않음

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    DocumentRoot "c:/wamp/www/yii/frontend/web" 
    <Directory "c:/wamp/www/yii/frontend/web"> 
    AllowOverride all 
    Require all granted 
    </Directory> 
    Alias /admin "c:/wamp/www/yii/backend/web" 
    <Directory "c:/wamp/www/yii/backend/web"> 
    AllowOverride all 
    Require all granted 
    </Directory> 
    ServerName florist 
    ErrorLog "logs/yii-error.log" 
    CustomLog "logs/yii-access.log" common 
</VirtualHost> 

URL. 내가

index.php에 적합한 적절한 메시지와 함께 종료() 함수를 배치 할 때

그러나 URL http://florist/admin/login이 /frontend/web/index.php

에 의해 처리 한 나는이 발견 무엇에있을 수 잘못 별칭?

+0

첫 번째 줄에 별칭을 넣으려고 했습니까? – Bizley

답변

0

내가 만든 simlink을 c:\wamp\www\yii\backend\web

mklink/D의 C에 : \ WAMP www가 \ YII의 \ 프론트 엔드 \ 웹 \ 관리 C \ : \ wamp \ www \ yii \ backend \ web

Options FollowSymLinks을 가상 호스트 정의에 추가하십시오. 문제가 해결되었습니다.

1

하는 것은 관리자의 하위 폴더에 htaccess로를 추가하십시오 :

Options +FollowSymLinks 
IndexIgnore */* 

RewriteEngine on 

# if a directory or a file exists, use it directly 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

# otherwise forward it to index.php 
RewriteRule . index.php