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
- Access your login page in the old fashioned way: http://domain.com/?q=user/login
- Login with your admin credentials. You'll get the 404 page after logging in but it will still "authenticate". submission but still login.
- Access http://domain.com/?q=admin/settings/clean-urls and disable clean URLs.
- The site will work now.
Credit goes to skalfyfan at StackOverflow for the workaround.
Full article available here.