I am trying to transfer my live site to a local host on my PC, I did the following:
All the website's files are in C:\xampp\htdocs\html. I also imported the database and changed env.php and web/secure/url and web/unsecure/url (to 127.0.0.1/html). The problem is that there are errors in the code where $_SERVER['DOCUMENT_ROOT'] is being used.
I tried changing inside httpd.conf the document root from
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
to
DocumentRoot "C:/xampp/htdocs/html"
<Directory "C:/xampp/htdocs/html">
And the result was that my site was showing, but all pages are 404.
Am I missing something? maybe some DB configuration or Magento's file for local environment?
thanks.
- 
 Make sure mod_rewrite module is installed in your local server. You can check using phpinfo() fucntion.Irfan Momin– Irfan Momin2017年10月16日 05:30:18 +00:00Commented Oct 16, 2017 at 5:30
 - 
 @Hezided Did you tried to install Magento on your local server is it compatible with your local configuration?Abhishek Tripathi– Abhishek Tripathi2017年10月16日 05:32:26 +00:00Commented Oct 16, 2017 at 5:32
 - 
 @IrfanMomin yes it's uncommented in httpd.conf.@ABHISHEK TRIPATHI not sure I understand your question...hezided– hezided2017年10月16日 16:08:59 +00:00Commented Oct 16, 2017 at 16:08
 
2 Answers 2
If you have changed your DocumentRoot to "C:/xampp/htdocs/html", then your web/unsecure/url entry will be "http://127.0.0.1/ " .
Change this entry in database and clear the cache. It should work for you.
- 
 I still get "page not found" everywhere...hezided– hezided2017年10月16日 07:03:02 +00:00Commented Oct 16, 2017 at 7:03
 - 
 can you please share the sceenshot of the browser page including the urlAman Srivastava– Aman Srivastava2017年10月16日 07:12:39 +00:00Commented Oct 16, 2017 at 7:12
 - 
 imgur.com/a/0tBzc the marked string means "page not found"hezided– hezided2017年10月16日 14:59:15 +00:00Commented Oct 16, 2017 at 14:59
 - 
 If you'll check the url in browser, it is 127.0.0.1/html it should be 127.0.0.1 then it will load the homepage.Aman Srivastava– Aman Srivastava2017年10月16日 17:07:27 +00:00Commented Oct 16, 2017 at 17:07
 - 
 yes it's true, but then if I click any link in my site the 'html' is added, for example: 127.0.0.1/html/sack-bags.htmlhezided– hezided2017年10月16日 17:20:16 +00:00Commented Oct 16, 2017 at 17:20
 
eventually what worked for me was to move all the files to separate folder (C:/myFolder), and change the DocumentRoot to there... also values of:
web/unsecure/base_url
web/secure/base_url
web/unsecure/base_link_url
web/secure/base_link_url