Last Updated: February 25, 2016
·
2.011K
· timfernihough

Only front page works on Drupal site

I recently had to work on one of our older projects that hasn't required any changes in a while. It isn't yet on Git (*shudder, I know. We all have at least one of these), so I had to boot up FileZilla to download the files.

So, I did this, and after getting my local environment up and running, NO PAGE BUT THE HOMEPAGE WOULD LOAD.

Turns out that FTP clients like FileZilla hide the hidden files so when I downloaded the files, I never got the .htaccess file with it. If the database has clean URL's enabled and no .htaccess file, Apache doesn't know how to rewrite the URLs into Drupal.

Solution: make sure you don't forget your .htaccess file. Without it, url rewriting won't work.

Work-around: disable clean URLs

  1. Access your login page in the old fashioned way: http://domain.com/?q=user/login
  2. Login with your admin credentials. You'll get the 404 page after logging in but it will still "authenticate". submission but still login.
  3. Access http://domain.com/?q=admin/settings/clean-urls and disable clean URLs.
  4. The site will work now.

Credit goes to skalfyfan at StackOverflow for the workaround.

Full article available here.