1
votes

I have a very simple question,I created my site unsing symfony 1.4,I also created three applications :

  • apps/frontend ==> exampel.com

  • apps/backend ==> example.com/backend.php

  • apps/mobile ==> mobile.example.com

for frontend and backend works fine on line server but for mobile version I created a subdomain(mobile.example.com) correctly but here is my problem.

How I configure symfony or server on line to access directly to mobile application when I browse the link mobile.exemple.com?

I mean I have all project in example.com folder not in subdomain(mobile.exemple.com) folder.

Any Idea?

Edit :

I hope subdomain for different applications not for different modules in one applicatoion!

2

2 Answers

0
votes

The link to symfony blog from this question shows that you can use sfRequestRoute configuration for this.

0
votes

I find a good solution and simple than using sfRequestRoute configuration,finally for me :

I change subdomain for different symfony applications and just to have one index.php controlling your project.

<?php


 require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');


 switch ($_SERVER['HTTP_HOST']) { 

case 'm.example.com': $configuration =    ProjectConfiguration::getApplicationConfiguration( 'mobile', 'prod', false); break;

 case 'backend.example.com'.....

default: $configuration = ProjectConfiguration::getApplicationConfiguration( 'frontend', 'prod', false); break; 

}

sfContext::createInstance($configuration)->dispatch(); 

and It's done.