<div dir="ltr">Hello all,<br><br>If this is not the right place for this question I appreciate if someone points me to some resources or mailing lists where I can ask. I have a couple of rewrite rules that simply refuse to work. Without too much noise, I&#39;ll post them here:<br>
<br>RewriteCond %{HTTP_HOST} !^<a href="http://apps.example.com">apps.example.com</a><br>RewriteCond %{HTTP_HOST} ^(.*).<a href="http://example.com">example.com</a><br>RewriteRule ^(.*)$ ${res:%1}/$1 [QSA]<br><br>The logic here is:<br>
<br>1. make sure the URL does not start with apps<br>2. isolate the first part of the URL and send it to an external app: The external app either returns &quot;members/&lt;subdomain&gt;&quot; or nothing. The alternative return values in the app are:<br>
    print &quot;\n&quot;; OR<br>    print &quot;members/{$subdomain}\n&quot;;<br>3. That&#39;s it.<br><br>The idea is that if I provide a subdomain such as:<br>- <a href="http://abc.example.com">abc.example.com</a>, I want it to pass through unchanged<br>
- <a href="http://def.example.com">def.example.com</a> should be rewritten to <a href="http://def.example.com/members/def">def.example.com/members/def</a><br><br>Am I doing something wrong here? Debugging rewrite rules seems to be something next to impossible so I&#39;m left without many alternatives than to ask someone more knowledgeable than me.<br clear="all">
<br>-- <br>Best Regards,<br>
Ashraf Amayreh<br>CEO | O-Minds<br>Cell. 962 78 8099997<br>Tel. 962 6 5655150<br>Fax. 962 6 5675150<br><br><a href="http://o-minds.com" target="_blank">o-minds.com</a><br>web development | web design<br>user experience | branding design<br>


</div>