I moved a site from a hosted server to my local machine and none of the links that point to internal pages work even though they look correct. I'm getting odd behaviour as described below. This is true even for the admin toolbar provided by the module (People, Modules, Configuration, etc.)

My process was as usual, I copied all the files down, exported/dumped the database, created a local db and then imported the dump.

(I'm putting in lh instead of localhost bec stackexchange won't allow links with localhost) I was able to login via lh/myidols5/?q=user but not lh/myidols5/user which gives 'access denied'. From lh/myidols5/?q=user, if I click on any link say the home button in the admin toolbar I go to the right page but am logged out. The address bar says lh/myidols5/ which is correct so I'm at a loss as to why I'm logged out.

Anyone know what the issue is?



1 Answer 1


I feel you're missing .htaccess file. Usually its a hidden file, so make sure to show all files (including hidden files) and copy it and paste it into your local drupal folder.

Also, make sure you local server has mod_rewrite enabled to support clean URLs, if its not enabled then check this answer: How to enable mod_rewrite in Apache?.

Another suggestion is; to turn off Clean URL from settings.php by adding the following code:

$conf['clean_url'] = 0;
  • Thank you for your suggestions. .htaccess is present and it is identical to .htaccess on another local site which is working. Would mod_rewrite go in apache2.conf? (running on a Ubuntu machine). I tried '$conf['clean_url'] = 0;' but it maid no difference.
    – klequis
    May 1, 2014 at 16:59
  • Actually, you are on to something. With $conf['clean_url'] = 0;' menu links are now working. However, clicking on the admin toolbar gives "Not Found The requested URL /myidols5/admin/appearance was not found on this server."
    – klequis
    May 1, 2014 at 17:11
  • using the url lh/myidols5/?q=admin/config instead of lh/myidols5/admin/config allowed me to get to the admin page and once I ran cron all admin pages started working. Now everything works with clean URLs off but when they are on I still get 'not found' for all links/menus.
    – klequis
    May 1, 2014 at 17:46
  • @user27175 in this case you need to enable mod_rewrite for Apache, check this out
    – Aboodred1
    May 1, 2014 at 21:21
  • thanks for you latest suggestion. Unfortunately, I was playing with the machine config, messed it up and needed to go back to an earlier snapshot which did not have the site so I'll need to download and start over. I did find an excellent article for configuring a Drupal dev environment on Ubuntu and it did say that mod_rewrite was necessary so I'm guessing you are right. I'll likely get back to this next week and will let you know how it goes. - thanks again.
    – klequis
    May 2, 2014 at 22:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.