Showing results for 
Search instead for 
Did you mean: 

Local Site redirects to live site

Re: Local Site redirects to live site

@dipmegpro  Thanks.

Now CSS is not loading. My Store looks like below now.

I used  php bin/magento setup:static-content:deploy -f and php bin/magento indexer:reindex. I deleted MAGENTO_ROOT/pub/static/adminhtml and MAGENTO_ROOT/pub/static/frontend and var/cache/ and var/page_cache/.

But CSS is not loading .

My var/log/debug.log file output is like below


[2021-12-10 12:27:17] main.DEBUG: cache_invalidate: {"method":"GET","url":"","invalidateInfo":{"identifier":"LOCKED_RECORD_INFO_SYSTEM_CONFIG"}} []
[2021-12-10 12:27:19] main.DEBUG: cache_invalidate: {"method":"GET","url":"","invalidateInfo":{"identifier":"LOCKED_RECORD_INFO_BLOCK_847756a4a1004c458426242fa97b0f3c858c0c4c"}} []


Re: Local Site redirects to live site

Hello @foysal
This video helped.
Open /etc/apache2/apache2.conf 


Find <Directory /var/www/>

Replace rules inside with below rules.

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted



If my answer is helpful full then please set the accept solution flag and kudos flag so other members can take the same reference.

Re: Local Site redirects to live site

@dipmegpro  Thanks.

Now I am getting `Exception: Warning: SessionHandler::read(): open(/var/cpanel/php/sessions/ea-php73/sess_7gjthlo29nrn8kc97hg5s4oall, O_RDWR) failed: No such file or directory (2) i`  error.

Re: Local Site redirects to live site

Hello @foysal 


Not, many ideas about this issue. please give Magento folder proper permission or 777 permission.

Re: Local Site redirects to live site

Hello everyone
I want to change the CMS of my website alltrackingcourier . Currently, I am using WordPress and not satisfied with its performance. My website is ranking on google and getting a lot of traffic. Will this effect on my website. I am unable to update any article of my website because the speed is very slow. Please do let me know how can I change it.  

Re: Local Site redirects to live site


  1. Hosts File & Virtual Host Configuration: Confirm your local URL is mapped to the correct IP in /etc/hosts and verify your virtual host configuration points to the right folder.

  2. Web Server Configuration: Ensure your web server is properly configured to serve your local site without conflicts.

  3. Browser Cache: Clear your browser cache or use a private window to avoid cached redirects.

  4. Magento Configuration: Verify base URLs in core_config_data table for accuracy.

  5. Reindex & Cache: Reindex and clear Magento cache with relevant commands.

  6. Check .htaccess File: Review .htaccess for possible redirect rules.

  7. Extensions & Themes: Temporarily disable custom extensions/themes to isolate the issue.

  8. Inspect Redirects: Use browser developer tools to analyze HTTP requests and responses.

  9. Server Logs: Check web server error logs for relevant messages.

  10. Developer Mode: Enable Magento developer mode for detailed error messages.

  11. JS Redirects: Inspect site source for JavaScript causing redirection.

  12. Different Browser: Test site on a different browser.

  13. DNS Configuration: Verify domain-based local URLs aren't resolving to live site IP.

  14. Local Firewall: Check local firewall settings that might affect site access.