I haven't updated or visited my site in a week. Now, all the URLs in my website redirect to the front page. Click some of the links. You'll see the URLs change accordingly, but all you see is the front page.

I have another Drupal site on the same webhost, and it's not having any problems.

Any ideas about why this could be happening? I have a database backup, so I can restore it if I need to. But I'd also like to know why this is happening.

Any ideas?

Comments

jaku ayala’s picture

alan d.’s picture

Is your ".htaccess" file still there? Also check that it still has content. If not, copy fresh copy from somewhere.

Good luck.


Alan Davison
www.caignwebs.com.au

Alan Davison
jaku ayala’s picture

This is the content of the htaccess, minus most of the comments.
Has this happened to you before? I didn't realize htaccess could just change on its own.

# 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_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0

# PHP 4, Apache 2.

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

# PHP 5, Apache 1 and 2.

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

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

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

# $Id: .htaccess,v 1.90 2007/10/05 14:43:23 dries Exp $

jaku ayala’s picture

All URLs redirect to front page, even /admin or /user.

Anyway, thanks for the responses, I just contacted my web host, see if they can help.

UPDATE:

I just reinstalled the blog with the database backup. Sidesteps the problem instead of solving it, but at least the site works again.

alan d.’s picture

On two occasions, I've had strange problems with core files, usually due to bugs with third party products, cPanel, etc. It's usually the first check.

In case this happens again, the rough steps that I'd follow are:
1) Check core files
2) Check the apache & other error logs. Often shows permission problems, etc
3) Nuke the cache tables (all of them): " TRUNCATE `cache`" or the empty command using phpmyadmin
4) Debug the code. In redirect problems, a debug trace from drupal_goto should be triggered.
-- If this pin-points a module that is calling the redirect, (and it is not one of core - required), disable it in system table and at least the site becomes functional.
...

Best of luck that it doesn't happen again

Cheers


Alan Davison
www.caignwebs.com.au

Alan Davison
jaku ayala’s picture

I actually spotted differences between the old htaccess file and the new one, so that must've had something to do with it :P

kenorb’s picture

beyond67’s picture

I had to enable rewrite module in apache and it worked.