<div dir="ltr">Well, the reason for the internal server error, awkwardly enough, is because I had FollowSymLinks inside the directory tags inside the virtual host tags<br><br>Options Indexes FollowSymLinks<br><br>Removing it solved the internal server error. In fact, I do use symlinks so I was puzzled on what to do. Adding Options +FollowSymLinks in the .htaccess file did it (it's already done in Drupal's .htaccess file). Strangely enough, you cannot declare this inside the directory tags but could through .htaccess and probably outside the directory tags too.<br>
<br>I also noted that "NULL" must be sent without a newline. For anyone who may try this in the future.<br><br>The final look for the rewrite rules are as follows:<br><br>RewriteCond %{HTTP_HOST} !^<a href="http://apps.jeeran.com" target="_blank">apps.example.com</a><br>
RewriteCond %{REQUEST_FILENAME} !-f<br>RewriteCond %{REQUEST_FILENAME} !-d<br>RewriteCond %{HTTP_HOST} ^(.*).<a href="http://jeeran.com" target="_blank">example.com</a><br>RewriteRule ^(.*)$ ${res:%1}$1 [QSA]<br><br>RewriteCond %{REQUEST_FILENAME} !-f<br>
RewriteCond %{REQUEST_FILENAME} !-d<br>RewriteCond %{REQUEST_URI} !=/favicon.ico<br>RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]<br clear="all"><br>I am bumping into the infinite loop problem though. And I'm not sure the proposed solution could work. In case the rewrite was transparent (app returns NULL), there's no way to know on future requests that I've done a previous rewrite. For example:<br>
<br>If <a href="http://abc.example.com">abc.example.com</a> returned a NULL, the URL will still be <a href="http://abc.example.com">abc.example.com</a> and not <a href="http://abc.example.com/members">abc.example.com/members</a> so I can't check against "members" to prevent an infinite loop, unless I misunderstood the proposed solution. With the above rewrite rules, I'm getting a very strange phenomena for non-rewriteen URLs (when the app returns NULL):<br>
<br><a href="http://abc.example.com/ar/members/abc/ar/members/abc/ar/members/abc/ar/members/abc/ar/members/abc/ar/abc/16474">http://abc.example.com/ar/members/abc/ar/members/abc/ar/members/abc/ar/members/abc/ar/members/abc/ar/abc/16474</a> (etc)<br>
<br>Of course it's too long to paste here. The error I get is 414 (Request-URI Too Large)<br><br>Any help still appreciated :)<br><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>