0
votes

I've got a Drupal site running under the main domain. With the following rewrite rules in the .htaccess file (rootlevel):

  # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

This works fine for the Drupal installation which uses PHP, but it somehow interferes with a newly created subdomain that just uses plain HTML. Upon loading the sub-domain site the browser produces an error message:

500 Internal Server Error

In the logs I find the following error messages:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

How can I adjust the .htaccess file so that requests for the subdomain are not affected by the rewrite code that is needed for Drupal to function? (While keeping that code functional for requests aimed at the site under the main domain, of course.)

1
Try adding another condition, RewriteCond %{HTTP_HOST} example.com that will make rewrites work only for your main domainDusan Bajic
Thanks for your suggestion, Dusan. That could work, but I stumbled across another solution provided by the Drupal community and decided to implement that one first. Since that works like a charm, I haven't gotten around to testing your idea. Here's the link to the page in question: drupal.org/node/30334 Look under the section called "Restore support for other Directory Index Files (index.htm)". It reads: "Drupals .htaccess file also includes a line (DirectoryIndex)... ...This replaces the normal webserver behaviour that usually says "return the index.htm file found there"."EyeInTheSky

1 Answers

0
votes

I stumbled across a solution provided by the Drupal community and decided to implement that one first. That works like a charm.

Here's the link to the page in question:

https://www.drupal.org/node/30334

Look under the section called:

"Restore support for other Directory Index Files (index.htm)".

It reads:

"Drupals .htaccess file also includes a line (DirectoryIndex) that gives instructions "If asked for a directory path, return the index.php file found in that directory". This replaces the normal webserver behaviour that usually says "return the index.htm file found there"..."