title: Redirect|Forward from old URL to new URL
body: <p>I had a route and a method that manipulated URLs in this way:</p>
  
  <pre><code>http://domain.com/combivent?email=WGA1cUtKZi4
  </code></pre>
  
  <p>Now that URL has changed into this one:</p>
  
  <pre><code>http://domain.com/?email=WGA1cUtKZi4
  </code></pre>
  
  <p>But old emails still keep the old one. I need to redirect each URL from the old way to the new one. For example if I call this <code>http://domain.com/combivent?email=WGA1cUtKZi4</code> then I should redirect to <code>http://domain.com/?email=WGA1cUtKZi4</code>how I can achieve this in Symfony2? Can I use any kind of wildcard in routes or do I need to keep both methods and handle this internally? Can this be done at <code>.htaccess</code> level? Any advice?</p>
  
  <p>This is how the <code>.htaccess</code> looks like:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
  
      RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
      RewriteRule ^(.*) - [E=BASE:%1]
  
      RewriteCond %{HTTP:Authorization} .
      RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  
      RewriteCond %{ENV:REDIRECT_STATUS} ^$
      RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
  
      RewriteCond %{REQUEST_FILENAME} -f
      RewriteRule .? - [L]
  
      # Remove combivent word from the URL when call a brand page
      RewriteRule ^combivent?email=([^/]+)$  /?email=$1 [L,QSA,R=301]
  
      RewriteRule .? %{ENV:BASE}/app.php [L]    
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Furthermore this <code>domain.com</code> is a Alias of a VirtualHost that share three domains. Think in the VH definition as:</p>
  
  <pre><code>ServerName maindomain.com
  ServerAlias domain.com
  ServerAlias domain1.com
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>Below is the full <code>.htaccess</code> definition:</p>
  
  <pre><code>DirectoryIndex app.php
  &lt;IfModule mod_negotiation.c&gt;
      Options -MultiViews
  &lt;/IfModule&gt;
  
  &lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
  
      RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
      RewriteRule ^(.*) - [E=BASE:%1]
  
      RewriteCond %{HTTP:Authorization} .
      RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  
      # Remove combivent word from the URL when call a brand page
      RewriteCond %{QUERY_STRING} ^email=[^&amp;]+ [NC]
      RewriteRule ^combivent/?$ / [L,R=301]
  
      RewriteCond %{ENV:REDIRECT_STATUS} ^$
      RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
  
      RewriteCond %{REQUEST_FILENAME} -f
      RewriteRule .? - [L]
  
      RewriteRule .? %{ENV:BASE}/app.php [L]
  &lt;/IfModule&gt;
  
  &lt;IfModule !mod_rewrite.c&gt;
      &lt;IfModule mod_alias.c&gt;
          RedirectMatch 302 ^/$ /app.php/
      &lt;/IfModule&gt;
  &lt;/IfModule&gt;
  </code></pre>