2011-08-16 5 views
0

공유 호스팅 계획에 Symfony 1.4를 설치하는 데 도움이되는 많은 정보를 찾았지만, 하루 종일 혼란스럽게하는 장애물이 있습니다.공유 호스팅의 Symfony 1.4 경로에서 'web'을 삭제 하시겠습니까?

http://www.alternium.net/jobeet/index.php으로 가면 http://www.alternium.net/jobeet/web/index.php의 파일 대신 404가 반환됩니다.

/jobeet/.htaccess :

Options +FollowSymLinks +ExecCGI 

# Enable rewrite engine and route requests to framework 
RewriteEngine On 
RewriteBase/

RewriteCond %{REQUEST_URI} ^/robots.txt 
RewriteRule ^(.*)$ /jobeet/web/robots.txt [L] 

# resources 
RewriteCond %{REQUEST_URI} ^/images/ [OR] 
RewriteCond %{REQUEST_URI} ^/js/  [OR] 
RewriteCond %{REQUEST_URI} ^/fonts/ [OR] 
RewriteCond %{REQUEST_URI} ^/css/  
RewriteRule ^(.*)$ /jobeet/web/$1 [L] 

RewriteCond %{REQUEST_URI} !^/jobeet/web/ 
RewriteCond %{REQUEST_URI} !^/frontend_dev.php 
RewriteRule ^(.*)$ /jobeet/web/index.php/$1 [QSA,L] 

RewriteCond %{REQUEST_URI} frontend_dev.php 
RewriteRule ^$ /jobeet/web/$1 [QSA,L] 

/jobeet/web/.htaccess : 나는 '어디

Options +FollowSymLinks +ExecCGI 

<IfModule mod_rewrite.c> 
    RewriteEngine On 

    # uncomment the following line, if you are having trouble 
    # getting no_script_name to work 
    #RewriteBase/

    # we skip all files with .something 
    #RewriteCond %{REQUEST_URI} \..+$ 
    #RewriteCond %{REQUEST_URI} !\.html$ 
    #RewriteRule .* - [L] 

    RewriteCond %{REQUEST_URI} \..+$ 
    RewriteCond %{REQUEST_URI} !\.html$ 
    RewriteCond %{REQUEST_URI} !\.php 
    #RewriteCond %{REQUEST_URI} !\.php 
    RewriteRule .* - [L] 

    # we check if the .html version is here (caching) 
    RewriteRule ^$ index.html [QSA] 
    RewriteRule ^([^.]+)$ $1.html [QSA] 
    RewriteCond %{REQUEST_FILENAME} !-f 

    # no, so we redirect to our front web controller 
    RewriteRule ^(.*)$ index.php [QSA,L] 

</IfModule> 

더 심포니의 I보다는 이해와 사람은 누구나 다시 작성할 수 있습니다 규칙이 말해 내가 잘못 가고있어?

답변

2

공유 호스트 (예 : plesk 호스트)에 개인 폴더가있는 경우 개인 폴더에 모든 symfony 폴더 (web /가 있어야 함)를 넣을 수 있습니다. 그런 다음 symfony configs에서 웹 디렉토리를 조정하고 프론트 컨트롤러 (index.php 또는 frontend_dev.php, ...)에서 ProjectConfiguration에 대한 경로를 조정해야합니다.

+0

필자는이 추상화 수준을 권장하지만, 우리는 시간의 위기에 처해 있습니다.이 구성이 대부분의 경우에는 생각할 필요가 없지만 가능한 한 시간을 절약해야하므로 가장 간단한 구성이됩니다. , 나를 위해, 거의 모든 경우에 최고가 될 것입니다. –

+0

이것은 가장 간단한 해결책이 될 것입니다.이를 달성하려면 두 줄의 코드가 필요합니다. 웹 디렉토리 이동에 대해서는 http://www.symfony-project.org/jobeet/1_4/Propel/en/22#chapter_22_customizing_the_directory_structure를 참조한 다음 Symfony 파일을 찾으려면 프론트 컨트롤러의 require 경로를 적절하게 조정하십시오. – richsage