symfony 1.4 not picking up subdirectory in routing?

132 Views Asked by At

I have one symfony 1.4 project where I can happily access the symfony app in a subdirectory www.olddomain.com/clients/

I have tried to achieve the same with another seperate project. www.newdomain.com/clients/ but the routing won't work fully. I can access www.newdomain.com/clients/ and it picks up the app and displays the login or content as it should BUT the login form submits to /login, NOT /clients/login as happens with the www.olddomain.com/clients/ project

, I have compared the two and cannot see any difference in the setup.

I have set the WebDir:

$this->setWebDir($this->getRootDir().'/content/clients/');

no_script_name is set to true

I have everything that would be in the web root (index.php, .htaccess, css js etc in /clients/.)

.htaccess in both cases contains

RewriteBase /clients/

If I access www.newdomain.com/clients/login it picks up the need to show the login form fine so that indicates my setup is OK BUT the login form which points to route @login is submitting the form to "/login" not "/clients/login".

I've tried dumping the route on both projects when I directly access /clients/login (see below) and have noticed that on the one that works there are a lot more variables in the 'context' including [ prefix: '/clients'] which would seem to be the key. All of this extra context information except the host variable is missing for www.newdomain.com/clients/login.

Can anyone help me understand what this means and how I might address it? How can I get this 'prefix' paramater set.

DOES WORK (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)
........

DOESN'T WORK (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)

.....

0

There are 0 best solutions below