Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal migration - now only front page works

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?

like image 365
bob Avatar asked Jan 21 '11 16:01

bob


4 Answers

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.

like image 111
skålfyfan Avatar answered Oct 05 '22 17:10

skålfyfan


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)

like image 26
bob Avatar answered Oct 05 '22 16:10

bob


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

like image 29
jamix Avatar answered Oct 05 '22 17:10

jamix


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

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

like image 30
toing_toing Avatar answered Oct 05 '22 16:10

toing_toing