Multiple issues - just started for no apparent reason

redrider - May 13, 2009 - 11:42

The links on my site just stopped working and I get page load errors for internal links.

Also, all of my Admin links now take me to my Gallery2 admin page.

I don't even know where to start the troubleshooting, any ideas would be appreciated.

I am using the latest Drupal update as of last week on a Godaddy VDS

Can you give an example URL

cog.rusty - May 13, 2009 - 11:56

Can you give an example URL of a broken internal link and of the URL of the page where this is happening? (http://example.com/node/10 or http://example.com/?q=node/10)

An example of the URL that you see when you hover the mouse over an Admin link and of the URL of the Gallery page where you end up?

Have you added some Redirect

cog.rusty - May 13, 2009 - 13:07

Have you added some Redirect or some RewriteRule in your .htraccess file (or in apache's conf) which redirects to main.php?

No, I have not.

redrider - May 13, 2009 - 17:59

No, I have not.

Can you compare the .htaccess

cog.rusty - May 13, 2009 - 18:28

Can you compare the .htaccess file which is in your web root directory with this one?

http://cvs.drupal.org/viewvc.py/drupal/drupal/.htaccess?revision=1.90.2....

Do you notice any differences?

# # Apache/PHP/Drupal

redrider - May 13, 2009 - 18:46

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
  Order allow,deny
</FilesMatch>

php_value output_buffering On
php_value output_handler mb_output_handler

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

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

# BEGIN Url Rewrite section
# (Automatically generated.  Do not edit this section)
<IfModule mod_rewrite.c>
    RewriteEngine On

    # The path to your Gallery (in this case example.com/gallery2/)
    RewriteBase /gallery2/

    RewriteRule ^admin /gallery2/main.php?g2_view=core.SiteAdmin   [QSA,L]
</IfModule>
# END Url Rewrite section



# Set the default handler.
DirectoryIndex index.php

php_value  upload_max_filesize  100M
php_value  post_max_size  100M
php_value  memory_limit 128M
php_value max_execution_time 1000
php_value max_input_time 1000

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

# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # 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
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  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.
  I can't compare files but here is my .htaccess file - I did notice your .htaccess solved the problems.

# 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 /

  # 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]
</IfModule>

# $Id: .htaccess,v 1.90.2.1 2008/07/08 09:33:14 goba Exp $

Apparently Gallery has added

cog.rusty - May 13, 2009 - 19:12

Apparently Gallery has added its own stuff in Drupal's .htaccess file, for example

RewriteBase /gallery2/

RewriteRule ^admin /gallery2/main.php?g2_view=core.SiteAdmin [QSA,L]

But I can't see clearly what is going on because Drupal filtered out the <...section...> tags from the code that you posted. Enclose the code between <code> and </code> tags.

## Apache/PHP/Drupal

redrider - May 13, 2009 - 19:20

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
  Order allow,deny
</FilesMatch>

php_value output_buffering On
php_value output_handler mb_output_handler

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

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

# BEGIN Url Rewrite section
# (Automatically generated.  Do not edit this section)
<IfModule mod_rewrite.c>
    RewriteEngine On

    # The path to your Gallery (in this case example.com/gallery2/)
    RewriteBase /gallery2/

    RewriteRule ^admin /gallery2/main.php?g2_view=core.SiteAdmin   [QSA,L]
</IfModule>
# END Url Rewrite section



# Set the default handler.
DirectoryIndex index.php

php_value  upload_max_filesize  100M
php_value  post_max_size  100M
php_value  memory_limit 128M
php_value max_execution_time 1000
php_value max_input_time 1000

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

# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # 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
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  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 /

  # 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]
</IfModule>

# $Id: .htaccess,v 1.90.2.1 2008/07/08 09:33:14 goba Exp $

If this is Drupal's .htaccess

cog.rusty - May 13, 2009 - 20:00

If this is Drupal's .htaccess file, the two lines added by Gallery are clearly wrong:

RewriteBase /gallery2/

The above line is disastrous and destroys all Drupal clean URLs. It should be either RewriteBase / or nothing. Generally a RewriteBase is only needed if your URL paths do not correspond to real directory paths (for example when they are apache aliases).

RewriteRule ^admin /gallery2/main.php?g2_view=core.SiteAdmin   [QSA,L]

I am not sure what this one is trying to do, but actually it makes Drupal's /admin section inaccessible. Maybe RewriteRule ^gallery2/admin /gallery2/main.php?g2_view=core.SiteAdmin   [QSA,L], but to be sure you will need to consult the Gallery guys at menalto.com or their documentation (or maybe the maintainer of the drupal gallery module).

Thank you so much for your

redrider - May 13, 2009 - 20:50

Thank you so much for your time on this.

 
 

Drupal is a registered trademark of Dries Buytaert.