2013-07-28 61 views
0

我有一個symfony應用程序,我使用.htaccess規則來訪問/ admin目錄。.htaccess文件到nginx

example.com/admin/content給了我一個404錯誤

example.com/backend_dev.php/admin/content給我我symfony的管理頁面預期。

選項+ +了FollowSymLinks ExecCGI

這裏是當前工作的.htaccess文件。

<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] 

    # 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 ^(.*)$ ../backend.php [QSA,L] 

</IfModule> 

我絕對不知道如何轉換這個或從哪裏開始尋找教程。

任何幫助/指南的鏈接將不勝感激。

+0

#strip app.php/prefix如果存在 重寫^/backend \ .php /?(.*)$/$ 1 permanent; location/admin {index}管理員內容backend.php; try_files $ uri @rewriteapp; } location @rewriteapp { rewrite ^(。*)$ /backend.php/$1 last; } – smugford

回答

1

看一看here。你會發現symfony 1.x和2的配置。

+0

感謝您的回覆,這就是我用來獲得主應用程序的工作。我有一個.htaccess文件,通過使用web/admin(我在symfony中創建的目錄)中的.htaccess文件來設置訪問backend.php。訪問/ admin /〜我正在尋找有關.htaccess的信息。 – smugford

+0

對不起,你是正確的重寫模塊是在symfony 2部分。 symfony 2中的重寫配置對於symfony 1.4非常適用 – smugford