<div dir="ltr">OK. I found one problem. The application is supposed to send a string saying "NULL" when the key is not found rather than a newline. So I changed print "\n" to print "NULL\n".<br>
<br>The problem now is that I'm getting an internal server error. I feel the rule keeps triggering recursively, isn't rules supposed to be a one time pass? Any help appreciated :)<br><br><div class="gmail_quote">On Wed, Mar 3, 2010 at 10:30 AM, Ashraf Amayreh <span dir="ltr"><<a href="mailto:mistknight@gmail.com">mistknight@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><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'll post them here:<br>
<br>RewriteCond %{HTTP_HOST} !^<a href="http://apps.example.com" target="_blank">apps.example.com</a><br>RewriteCond %{HTTP_HOST} ^(.*).<a href="http://example.com" target="_blank">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 "members/<subdomain>" or nothing. The alternative return values in the app are:<br>
print "\n"; OR<br> print "members/{$subdomain}\n";<br>3. That's it.<br><br>The idea is that if I provide a subdomain such as:<br>- <a href="http://abc.example.com" target="_blank">abc.example.com</a>, I want it to pass through unchanged<br>
- <a href="http://def.example.com" target="_blank">def.example.com</a> should be rewritten to <a href="http://def.example.com/members/def" target="_blank">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'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>
</blockquote></div><br><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">o-minds.com</a><br>
web development | web design<br>user experience | branding design<br>
</div>