我有一个symfony 1.4项目,我可以愉快地访问子目录www.olddomain.com/clients/中的symfony应用程序
我试图与另一个单独的项目实现相同的目标。 www.newdomain.com/clients/但路由将无法完全运行。 我可以访问www.newdomain.com/clients/然后它会选择应用程序并显示登录或内容,但应该登录表单提交到/ login,NOT / clients / login,就像www.olddomain.com/一样客户/项目
,我比较了两者,但在设置上看不出任何差异。
我已经设置了WebDir:
$this->setWebDir($this->getRootDir().'/content/clients/');
no_script_name设置为true
我拥有Web根目录中的所有内容(/ clients /中的index.php,.htaccess,css js等)
两个案例中的.htaccess都包含
RewriteBase /clients/
如果我访问www.newdomain.com/clients/login,则需要显示登录表单,以便表明我的设置正常但是指向路由@login的登录表单正在将表单提交给“/登录“not”/ clients / login“。
当我直接访问/ clients / login(见下文)时,我已经尝试在两个项目上转储路由,并注意到在那个有效的那个上,'context'中有更多变量,包括[prefix:' / clients']这似乎是关键。 www.newdomain.com/clients/login缺少除主机变量之外的所有额外上下文信息。
任何人都可以帮助我理解这意味着什么,以及我如何解决它?我怎样才能得到这个'前缀'参数集。
做好工作(www.olddomain.com/clients/login)
object(sfRoute)[31]
protected 'isBound' => boolean true
protected 'context' =>
array
'path_info' => string '/login' (length=6)
'prefix' => string '/clients' (length=8)
'method' => string 'GET' (length=3)
'format' => null
'host' => string 'www.olddomain.com'
'is_secure' => boolean false
'request_uri' => string 'http:/www.olddomain.com/clients/login'
protected 'parameters' =>
array
'module' => string 'sfGuardAuth' (length=11)
........
不工作(www.newdomain.com/clients/login)
object(sfRoute)[47]
protected 'isBound' => boolean true
protected 'context' =>
array
'host' => string 'www.newdomain.com'
protected 'parameters' =>
array
'module' => string 'sfGuardAuth' (length=11)
.....