Hi all,

I just updated the server from php4/mysql4 to php5/mysql5. The drupal site ran well before update. But right now just the index page can display. Clicking any link from the index page causes a 500 error.

Here is the info from log file:

[Thu Feb 19 12:02:47 2009] [error] [client 68.236.220.129] 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., referer: http://www.voxsi.net/

Here is what I got when I clicked a link from main page

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@voxsi.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

And .htaccess file:

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.

Order allow,deny

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1.

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0

# PHP 4, Apache 2.

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0

# PHP 5, Apache 1 and 2.

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0

# Requires mod_expires to be enabled.

# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not cache dynamically generated pages.
ExpiresByType text/html A1

# Various rewrite rules.

RewriteEngine on

# If your site can be accessed both with and without the prefix www. you
# can use one of the following settings to force user to use only one option:
#
# If you want the site to be accessed WITH the www. only, adapt and
# uncomment the following:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule .* http://www.example.com/ [L,R=301]
#
# If you want the site to be accessed only WITHOUT the www. prefix, adapt
# and uncomment the following:
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule .* http://example.com/ [L,R=301]

# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
RewriteBase /drupal

# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]

# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]

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

# $Id: .htaccess,v 1.81 2007/01/09 09:27:10 dries Exp $

Comments

cog.rusty’s picture

Why do you have RewriteBase /drupal? Did you have it in a drupal subdirectory previously?

Try changing it to RewriteBase / or disable that line with a front #

jjuner’s picture

Thank you for your relpy.

Yeah, I did it. But it doesn't work.
Actually there are several virtual hosts. All the sites are in the folder /var/www/. In the file .htaccess in the folder I comment out the RewriteBase, but in the site "voxsi.net" which installed drupal, I changed the .htaccess file (in /var/www/voxsi.net) with this:

RewriteBase /http://www.voxsi.net

Is that correct? But it could not solve the problem.

Here is the .htaccess file in /var/www/voxsi.net

# Various rewrite rules.
##
RewriteEngine on

# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment and adapt the following:
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
RewriteBase /http://www.voxsi.net

# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]

# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]

# Rewrite current-style URLs of the form 'index.php?q=x'.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

cog.rusty’s picture

No, it is wrong. It should be RewrirteBase /

RewriteBase (when it is needed at all) doesn't care about the domain name or about the file path, only about the URL path (see http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritebase).

Does your .htaccess file take effect immediately? On some host it takes a couple of hours, or so I have heard.

Notice that it is certain that it is an url rewrite problem, because
http://www.voxsi.net/node doesn't work
http://www.voxsi.net/?q=node works

jjuner’s picture

Yeah, as you said, after I changed to RewrirteBase /

the 500 error gone.

and now we got "page not found" problem. And the same:

http://www.voxsi.net/node doesn't work
http://www.voxsi.net/?q=node works

But how can I fix the url?

I really appreciate your help!

cog.rusty’s picture

Hmm... It doesn't seem fixed to me. Clean URLs still don't work.

You may need to disable them in admin/settings/clean-urls to make Drupal stop using them until the problem is found and fixed. There are several different things which may be wrong. (See http://drupal.org/node/15365).

jjuner’s picture

It is done.
After the update, Apache has not loaded the rewrite_mod.
Thank you so much, cog.rusty.

jjuner’s picture

Thank you so much for your help

It works immediately.

But now we got the "page not found" problem when click a link from main page.

That means I need to update all the ./htaccess files in all subdirectories?

Actually I am not sure what I should do ...

cog.rusty’s picture

Subdirectories? What subdirectories and what kind of .htaccess files do they have?

chrisfromredfin’s picture

I am running PHP as FastCGI and if you forget to put a ScriptAlias in your VirtualHost you can get this error. Just thought I'd tack this on since this is the top result page for this error (+drupal) in Google.

i.e. on Ubuntu this worked for me:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

.cw.

yaach’s picture

I had the same problem, getting 505 error after installing Drupal 8 on Ubuntu. I originally had:

RewriteBase /drupal8

on my .htaccess file (located on /www/drupal8/) but then I comment that line and it worked. Now the admin menu links are not broken.

# RewriteBase /drupal8

Thanks!