获取有路由/触发器问题的请求

时间:2014-11-19 09:49:38

标签: symfony routing

我在symfony2.3中遇到了路由问题,我找不到解决问题的方法。 奇怪的是,我可能是唯一一个遇到这种麻烦的人。

首先,我将展示我的路线。

homepage:
    pattern:  /
    defaults: { _controller: AppUserBundle:Default:profile, id: null }

user_list:
    path:     /user/list
    defaults: { _controller: AppUserBundle:Default:index }

成功登录后,用户会看到以下网址“domain.com/app_dev.php/”。

现在,如果用户单击任何URL作为示例“所有用户列表”,则网址将更改为“domain.com/app_dev.php//user/list”,并且此GET请求会触发错误,因为该路由不存在。 app_dev.php之后的斜杠,触发问题。

我正在使用symfony 2.3的默认htaccess。

我的主机配置如下所示:

<VirtualHost *:80>
    ServerName app.dev-local

    ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/app/trunk/web/$1

    DocumentRoot /var/www/app/trunk/web
    <Directory /var/www/app/trunk/web>
        # enable the .htaccess rewrites
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog /var/www/logs/app-error.log
    CustomLog /var/www/logs/app-access.log combined
</VirtualHost>

我正在寻找解决方案的几天,我很绝望。

我该怎么做才能解决我的问题?有没有人有同样的问题?

更新,路由调试信息:

_wdt                               ANY    ANY    ANY  /_wdt/{token}
_profiler_home                     ANY    ANY    ANY  /_profiler/
_profiler_search                   ANY    ANY    ANY  /_profiler/search
_profiler_search_bar               ANY    ANY    ANY  /_profiler/search_bar
_profiler_purge                    ANY    ANY    ANY  /_profiler/purge
_profiler_info                     ANY    ANY    ANY  /_profiler/info/{about}
_profiler_phpinfo                  ANY    ANY    ANY  /_profiler/phpinfo
_profiler_search_results           ANY    ANY    ANY  /_profiler/{token}/search/results
_profiler                          ANY    ANY    ANY  /_profiler/{token}
_profiler_router                   ANY    ANY    ANY  /_profiler/{token}/router
_profiler_exception                ANY    ANY    ANY  /_profiler/{token}/exception
_profiler_exception_css            ANY    ANY    ANY  /_profiler/{token}/exception.css
_configurator_home                 ANY    ANY    ANY  /_configurator/
_configurator_step                 ANY    ANY    ANY  /_configurator/step/{index}
_configurator_final                ANY    ANY    ANY  /_configurator/final
app_user_profile                   ANY    ANY    ANY  /user/show-profile/{id}
app_user_list                      ANY    ANY    ANY  /user/list
app_user_activate                  ANY    ANY    ANY  /user/activate/{id}
app_user_deactivate                ANY    ANY    ANY  /user/deactivate/{id}
app_user_delete                    ANY    ANY    ANY  /user/delete/{id}
app_user_edit                      ANY    ANY    ANY  /user/edit/{id}
app_user_add                       ANY    ANY    ANY  /user/add
app_user_absense_archive           ANY    ANY    ANY  /user/absense/archive/{id}
app_user_register                  ANY    ANY    ANY  /user/register
app_register_confirm               ANY    ANY    ANY  /user/confirm/{id}
app_user_password_change           ANY    ANY    ANY  /user/password/change/{id}
app_user_password_generate         ANY    ANY    ANY  /user/password/generate
app_user_export                    ANY    ANY    ANY  /user/export/{format}
app_permissions_list               ANY    ANY    ANY  /permissions
app_permissions_add                ANY    ANY    ANY  /permissions/add
app_permissions_edit               ANY    ANY    ANY  /permissions/edit/{id}
app_permissions_delete             ANY    ANY    ANY  /permissions/delete/{id}
app_roles_list                     ANY    ANY    ANY  /roles
app_roles_add                      ANY    ANY    ANY  /roles/add
app_roles_edit                     ANY    ANY    ANY  /roles/edit/{id}
app_roles_delete                   ANY    ANY    ANY  /roles/delete/{id}
app_permissionsCategory_list       ANY    ANY    ANY  /permissions-category
app_permissionsCategory_add        ANY    ANY    ANY  /permissions-category/add
app_permissionsCategory_edit       ANY    ANY    ANY  /permissions-category/edit/{id}
app_permissionsCategory_delete     ANY    ANY    ANY  /permissions-category/delete/{id}
app_permissionsCategory_activate   ANY    ANY    ANY  /permissions-category/activate/{id}
app_permissionsCategory_deactivate ANY    ANY    ANY  /permissions-category/deactivate/{id}
app_exclusionPeriods_list          ANY    ANY    ANY  /exclusion-periods
app_exclusionPeriods_add           ANY    ANY    ANY  /exclusion-periods/add
app_exclusionPeriods_edit          ANY    ANY    ANY  /exclusion-periods/edit/{id}
app_exclusionPeriods_delete        ANY    ANY    ANY  /exclusion-periods/delete/{id}
app_exclusionPeriods_activate      ANY    ANY    ANY  /exclusion-periods/activate/{id}
app_exclusionPeriods_deactivate    ANY    ANY    ANY  /exclusion-periods/deactivate/{id}
app_user_import_user               ANY    ANY    ANY  /import/user
app_user_import_school             ANY    ANY    ANY  /import/school
app_locale_list                    ANY    ANY    ANY  /locale
app_locale_add                     ANY    ANY    ANY  /locale/add
app_locale_delete                  ANY    ANY    ANY  /locale/delete/{id}
app_locale_edit                    ANY    ANY    ANY  /locale/edit/{id}
app_locale_activate                ANY    ANY    ANY  /locale/activate/{id}
app_locale_deactivate              ANY    ANY    ANY  /locale/deactivate/{id}
app_locale_change                  ANY    ANY    ANY  /locale/change/{locale}
login                              ANY    ANY    ANY  /login
homepage                           ANY    ANY    ANY  /
login_check                        ANY    ANY    ANY  /login_check
logout                             ANY    ANY    ANY  /logout

没有人可以帮助我吗?或者没有同样的问题?

0 个答案:

没有答案