title: symfony1, hosting, document root and apache mod_rewrite
body: <p>I've read a lot about this but i can't make it work, so, i'm posting a question  </p>
  
  <p>I have a <code>Symfony1</code> project with 2 app(front, admin), the hosting document root is <code>public_html</code>, so the folder structure look like:</p>
  
  <pre><code>/public_html
  |--/apps/
  |--/cache/
  |........
  |--/web/
  </code></pre>
  
  <p>the support team told me they can't not change the document root for me, so, all i have to do is start trying with <code>.htaccess</code> and this is what i did:</p>
  
  <pre><code>RewriteEngine on
  AddHandler application/x-httpd-php53 .php
  RewriteBase /web/
  
  RewriteCond %{REQUEST_URI} ^/admin.php
  RewriteRule ^(.*)$ /web/admin.php/$1 [QSA,L]
  
  RewriteRule ^(.*)$ /web/$1 [QSA,L]
  </code></pre>
  
  <p>this works ok, but symfony generate the urls with <code>/web</code>, so, i created a custom class that extend from <code>sfPatternRouting</code>, override the <code>generate</code> function to return something like this:</p>
  
  <pre><code>public function generate($name, $params = array(), $absolute = false) {
      $url = parent::generate($name, $params, $absolute);
      $pattern = '/\/web\//';
      return preg_replace($pattern,'/', $url);
  }
  </code></pre>
  
  <p>and this works ok again, i have pretty url and works ok, but, when y try to access to <code>http://my.domain.com/admin.php/</code> i get <code>404 Page not found error</code> and all for the admin app isn't working, url <code>/admin.php/services</code> same result, always the same, so, i recreate the same environment in my local pc, and works ok, but in the hosting it doesn't work.</p>
  
  <p>So, the .htaccess config i made should work? do i need more conditions and rewrites rules for this to work the way i want?<br>
  can the .htaccess that comes inside the <code>/web</code> folder affect?</p>
  
  <p>the hosting is www.bluehost.com<br>
  Need some help<br>
  Thanks</p>