Just an FYI: Dreamhost recently disallowed FollowSymLinks on all their servers, so the standard Drupal .htaccess (and sites/default/files/.htaccess) will cause a 500 error. Replacing the instances of FollowSymLinks with SymlinksIfOwnerMatch resolves this on Dreamhost.<br>
<br>I only mention this because anybody who perked up at the mention of FollowSymLinks might want to know.<br><br>Apparently Dreamhost has encountered a security risk of using FollowSymLinks. I wonder if we should update the Drupal ..htaccess and sites/default/files/.htaccess in line with this. Any opinions?<br>
<br>-Randy<br><br><div class="gmail_quote">On Wed, Mar 3, 2010 at 11:03 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">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:<div class="im"><br><br>RewriteCond %{HTTP_HOST} !^<a href="http://apps.jeeran.com" target="_blank">apps.example.com</a><br>
</div>
RewriteCond %{REQUEST_FILENAME} !-f<br>RewriteCond %{REQUEST_FILENAME} !-d<div class="im"><br>RewriteCond %{HTTP_HOST} ^(.*).<a href="http://jeeran.com" target="_blank">example.com</a><br></div>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" target="_blank">abc.example.com</a> returned a NULL, the URL will still be <a href="http://abc.example.com" target="_blank">abc.example.com</a> and not <a href="http://abc.example.com/members" target="_blank">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" target="_blank">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 :)<div class="im"><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></div>
</blockquote></div><br><br clear="all"><br>-- <br>Randy Fay<br>Drupal Development, troubleshooting, and debugging<br><a href="mailto:randy@randyfay.com">randy@randyfay.com</a><br>+1 970.462.7450<br><br>