2014-01-12 2 views
2

Symfony2가 GoDaddy 공유 호스팅 계획 (여러 사이트 포함) 작업에 가까워졌습니다.여러 사이트와 공유되는 GoDaddy의 Symfony2

/    <-- dummy domain points here to "hide" it sort of 
----/SiteA  <-- sitea.com (Wordpress, working fine) 
----/SiteB  <-- siteb.com (Wordpress, working fine) 
----/SiteC  <-- sitec.com (Wordpress, working fine) 
----/Symfony 
--------/app 
--------/web <-- symfonysite.com 
------------/.htaccess 
------------/app.php 

내가 잘 symfonysite.com에서 기본 컨트롤러에 액세스 할 수 있습니다

그래서 나는 웹/FTP를 통해 액세스 할 다음 있습니다 (참고, 내가 SSH를 통해 액세스 할 수있는이 위의 다른 디렉토리 레벨이있다). 하지만 링크 (예 : symfonysite.com/my/page)를 클릭하면 500 오류가 발생합니다.

내가 symfonysite.com/app.php으로 갈 때 더 이상합니다. 나는 symfonysite.com/Symfony/web에있다.

올바르게 다시 쓰여지지 않기 때문에 분명히 내 .htaccess에 뭔가가 올바르지 않습니다. 어쨌든 웹 루트와 관련이 있으며 특정 파킹 된 도메인의 루트가 아닙니다. 나는 이것이 쉬운 수정이라고 생각하지만, .htaccess에 익숙하지 않다. (이것은 2.3의 기본값이다.) 여기가 제거 의견, 다음과 같습니다 :

내가 게시되면서
DirectoryIndex app.php 

<IfModule mod_rewrite.c> 
    RewriteEngine On 

    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 
    RewriteRule ^(.*) - [E=BASE:%1] 

    RewriteCond %{ENV:REDIRECT_STATUS} ^$ 
    RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] 

    RewriteCond %{REQUEST_FILENAME} -f 
    RewriteRule .? - [L] 

    RewriteRule .? %{ENV:BASE}/app.php [L] 
</IfModule> 

<IfModule !mod_rewrite.c> 
    <IfModule mod_alias.c> 
     RedirectMatch 302 ^/$ /app.php/ 
    </IfModule> 
</IfModule> 

답변

2

, 나는 더 밀접하게 .htaccess의 의견을 읽고 답을 알아 냈어. 이 Q 글을 올리시면 다른 사람들을 도울 수 있습니다.

문제

는 여기에 있습니다 :

# Determine the RewriteBase automatically and set it as environment variable. 
# If you are using Apache aliases to do mass virtual hosting or installed the 
# project in a subdirectory, the base path will be prepended to allow proper 
# resolution of the app.php file and to redirect to the correct URI. It will 
# work in environments without path prefix as well, providing a safe, one-size 
# fits all solution. But as you do not need it in this case, you can comment 
# the following 2 lines to eliminate the overhead. 
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 
RewriteRule ^(.*) - [E=BASE:%1] 

내가 그 /Symfony/web/app.php 대신 /app.php로 내 재 작성을 변화 믿습니다. 그 라인을 주석 처리했습니다.

+0

당신은 생명의 은인입니다! – gtsouk

관련 문제