title: routing and module in symfony 1.4
body: <p>I have a serious problem about routing and envirenement or module in symfony 1.4,so I created three modules frontend , mobile and backend.</p>
  
  <p>So in frontend and mobile module,I'm using almost the same routing : </p>
  
  <pre><code>//apps/frontend/config/routing.yml
  
  home:
   url:   /home
   param: { module: user, action: home }
  
  homepage:
   url:   /
   param: { module: content, action: index } 
  
    ....
  
  default_index:
   url:   /:module
   param: { action: index }
  
  default:
   url:   /:module/:action/*
  </code></pre>
  
  <p>mobile module : </p>
  
  <pre><code>//apps/mobile/config/routing.yml
  
  home:
   url:   /home
   param: { module: user, action: home }
  
  homepage:
   url:   /
   param: { module: sfGuardAuth, action: signin } 
  
    ....
  
  default_index:
   url:   /:module
   param: { action: index }
  
  default:
   url:   /:module/:action/*
  </code></pre>
  
  <p>I use the link to access to my site </p>
  
  <pre><code>mysite.com/  ==&gt; frontend module(frontend.php)
  mysite.com/mobile.php ==&gt; mobile module(mobile.php)
  </code></pre>
  
  <p>The problem is when I access to mobile version to login page correctly but after login they redirect me to homepage of frontend module not to the home page of mobile module?</p>
  
  <p>Remark : </p>
  
  <p>when I use this link <code>mysite.com/mobile_dev.php</code> with dev env the mobile version works very fine!</p>
  
  <p>Edit : </p>
  
  <p>here is my htaccess : </p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteCond %{QUERY_STRING} ^(%2d|-)[^=]+$ [NC]
  RewriteRule ^(.*) $1? [L]
  &lt;/IfModule&gt;
  
  Options +FollowSymLinks +ExecCGI
  
   &lt;IfModule mod_rewrite.c&gt;
   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 ^(.*)$ index.php [QSA,L]
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>So when I change <code>index.php</code> to <code>mobile.php</code> the link <code>mysite.com/mobile.php</code>go directly to to mobile version homepage and all works fine...</p>
  
  <p>So my issue now is how to edit my .htaccess to redirect me like this : </p>
  
  <pre><code>mysite.com/index.php or mysite.com/  redirect me to my site 
  mysite.com/mobile.php redirect me to mobile version
  </code></pre>
  
  <p>Edit2 : </p>
  
  <p>I explain you,when I start with this link <code>mysite.com/mobile.php</code> so it redirect me to mobile apps to login page but when after login instead it go to my homepage the new request search  default front controller  and it point on index.php so that give me the homepage of frontend apps not the mobile apps!</p>
  
  <p>So why symfony with <code>mobile_dev.php</code> keep in memory it all time that we are in mobile dev env and with <code>mobile.php</code>it switch me from prod mobile env to frontend prod env in first redirection? </p>