views:

34

answers:

1

I am trying to create an exact mirror of a Magento production server on my local server for further development, but I have run into a few issues.

On the production server, our Magento is configured to run without displaying the index.php, but after attempting a migration to my local server, the index.php is required to access any links. Additionally, when I select a category to visit (for example), I am directed to http://localhost/category.html instead of http://localhost/my-magento-store.com/index.php/category.html

The other issue I've noticed is that I am unable to log in to the admin section. After entering the correct login credentials, I am redirected to the login screen again without any error messages.

I am running a MAMP stack on the local server, and here is what I have done:

  1. Created a tar of the entire production server
  2. Created a database backup in Magento System > Tools > Backups
  3. Downloaded and extracted tar into local directory
  4. Imported database dump into local MySQL using Alexey Ozerov's big dump script. (The .sql file is 1.3m lines)
  5. Changed values of web/unsecure/base_url and web/secure/base_url in core_config_data table. (As I don't have a self-signed SSL cert, I put http://localhost:8888/my-magento-store/ for both values)
  6. Dumped contents of var/cache and var/sesson
  7. Changed permissions to 755 for all files on local dev server
  8. Navigated to http://localhost:8888/my-magento-store/ but got the "Index of /" page instead.
  9. Navigated to http://localhost:8888/my-magento-store/index.php and got an error.
  10. Followed these steps to solve the error, reloaded the page, and the home page loaded correctly.

Any ideas?

+1  A: 

URL Rewriting depends on your .htaccess file, so there are a couple of things to check:

  1. web/seo/use_rewrites in core_config_data should be true.
  2. when you created your tarball, did it include . files in the root directory especially .htaccess? If you used tar -cvf archive.tar * then it may have missed them. (Nice "feature" of *nix).
  3. Check that your MAMP httpd.conf has AllowOverride All, otherwise your local .htaccess will be ignored.
  4. I'm not familiar with MAMP, but it's possible that it's having a problem reading/interpreting your .htaccess, though this is unlikely. I'd focus on options 1 thru 3 first.

HTH, JD

Jonathan Day
Thank you! It turned out that I was only missing the .htaccess files from my server which tar * wouldn't copy but tar ./ would.
Jason