title: PHP RewriteRule detect if url contain "string" and replace
body: <p>This may be a basic question regarding RewriteRule but I just counldn't make it work. </p>
  
  <p>What I want to do is detect urls like:</p>
  
  <pre><code>mydomain/myapp/id/some/random/url.html?param=somethingThatIdoUse
  mydomain/myapp/id/other/randomabc/perrito.php?param=somethingThatIdoUse
  ... 
  </code></pre>
  
  <p>The part that I need to discart is from the <code>/id/[all this]?param=somethingIdoUse</code> and use the param if is possible or send the complete url as param so I can regex to get the param. </p>
  
  <p>And have a rule that detect that <code>/id/</code> exist and redirect to something like:</p>
  
  <pre><code>mydomain/myapp/other/manageRequest.php?params=somethingThatIdoUse 
  </code></pre>
  
  <p>(the params I could get the whole url and strip it as string is no problem) </p>
  
  <p>As well the application have different modules like:</p>
  
  <pre><code>mydomain/myapp/moduleOne/index.php 
  mydomain/myapp/moduleTwo/index.php 
  </code></pre>
  
  <p>This have to keep working the same. </p>
  
  <p>As far I've tried some of them like: </p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{THE_REQUEST} ^GET /.*;.* HTTP/
  RewriteCond %{QUERY_STRING} !^$
  RewriteRule .* http://localhostdev/app/index.php %{REQUEST_URI}? [R=301,L]
  
  
  RewriteEngine On
  RewriteBase /spt/
  RewriteCond %{REQUEST_FILENAME} !^id$ [NC]
  RewriteRule ^(.*)$ index.php [R=301,L]
  
  RewriteEngine On
  RewriteCond %{REQUEST_URI} !/campaings/response\.php$
  RewriteRule ^/something/(.*) /other/manageRequest.php? [L]
  </code></pre>
  
  <p>But nothing seamed to do kind of what I needed. </p>
  
  <p>Thanks in advice</p>