简体   繁体   中英

Drupal-site .htaccess blocks access to index.html for subdomain [500 Internal Server Error]

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.)

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"..."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM