Drupal migration - now only front page works

2019-04-22 13:16发布

问题:

I just migrated a Drupal site from a ISP to a dedicated Linux CentOS server.

MySQL Database is configured and generates front page without error.

Problem is that only the home page works. All other pages show "404 Page Not Found Error".

So mysite.com/ works but mySite.com/node/1 does not work.

I checked some obvious places:

LoadModule rewrite_module modules/mod_rewrite.so is enabled in httpd.conf

Any ideas?

回答1:

I've had this happen before. It could be because your new Linux Centos OS server isn't configured for clean URLs yet.

Try to access the site as follows. To login: http://example.com/?q=user/login

Login as admin and submit the form. You'll get access denied 404 page again after submission but still login.

Now manually type and go to http://example.com/?q=admin/settings/clean-urls

On this page turn off clean-urls and save and you should be able to access your site normally on the new server. Just configure it for clean-urls and then turn it back on when it's ready.



回答2:

thanks Kevin,

mysite.com/?q=node/1? gives me a 404.

.htaccess was indeed missing. I copied in a generic version from a vanilla install into root directory (same directory as index.html) and this does not help.

(I don't have access to old site. We did not modify .htaccess - so I assume vanilla copy will do)



回答3:

Another possibility: If it's a new server, make sure that Apache has mod_rewrite installed. Happened to me.



回答4:

If you have drupal 7 or higher use this for the clean-url config page:

mysite.com/?q=admin/config/search/clean-urls



回答5:

Check to see that the .htaccess file made it through the migration. Usually the culprit here. Can you get to mysite.com/?q=node/1?