I have to move an existing Drupal site from one server to another. I've done so by doing a mysql database export/import and copying over the files to the new server. On the new system, the root page comes up fine but if I try to go to any deeper directory levels I get a 404 Not Found Error.
so drupal.newserver.com -> works fine but drupal.newserver.com/user -> gives me a 404 and happens,same for all subdirectories
Is there something that I'm missing that is part of a drupal export? Could it be related to the structure of the /sites directory which is under the webserver's docroot?- which has a folder named after the old server (ie drupal.oldserver.com but not drupal.newserver.com? Also, I noticed that there are _htaccess files and .hta files but not .htaccess files in the site files that I've copied over.
Sorry if I'm asking a bleedingly obvious question - I'm very new to Drupal. Thank you!
Comments
=-=
ensure that the core .htaccess file was copied to the new host (it would be in the root, same level as index.php)
ensure that the apache mod_rewrite is enabled (particularly if clean urls was enabled)
ensure that all cache tables in the database were emptied
the .htaccess file wasn't
unfortunately none of those steps seems to have helped.
here is some additional info in case it makes anything clearer
trying to go to /?q=user, the browser redirects to /user and then immedaitely displays "Not Found The requested URL /user was not found on this server." - it doesn't display a login widget at all, just goes straight to the error page
trying to go to /?q=admin/settings/clean-urls - the site displays "Access denied You are not authorized to access this page." but does so with all the sites's branding and stylesheets.
just taking a look at the webserver's errors logs, I'm seeing this error: [Mon May 13 16:04:05 2013] [error] [client xxxxx] File does not exist: /var/www/html/user so it doesn't appear that the system is correctly mapping the /user request into Drupal's url control system
Thanks so much!
resolution
Just to let anyone who might come across via a google search - I was able to get this to work . It turns out that while mod_rewrite was enabled, what I had to do was to enable the AllowOverride directive for the web directory in httpd.conf to be set to ‘All’. If it’s not set to this, the server won’t respect the .htaccess rules you put into the drupal directory. It’s been a while since I’ve worked with apache config files so it took a while to finally piece it together. The main breakthrough came when I realized that if I turned off clean-urls then the links worked but looked ugly and then was able to research clean_url.