cancel
Showing results for 
Search instead for 
Did you mean: 

Starting Magento on Xampp ERR_TOO_MANY_REDIRECTS

Starting Magento on Xampp ERR_TOO_MANY_REDIRECTS

Hello, I have been a long time without using Magento, and I was trying to make a local copy of Magento on XAMPP. I've downloaded the files from the authorized website and already installed and updated Composer in the htdocs folder in XAMPP, where the Magento files are located.

 

F:\xampp\htdocs>composer install --ignore-platform-reqs
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove

 

"I went to localhost to start the Magento installation, but I always encounter this error: "ERR_TOO_MANY_REDIRECTS". I've already cleared the cache and cookies and attempted to run it from a different browser, but nothing seems to work.

I don't recall Magento being this difficult to install locally. I remember that some years ago, it was very easy to get a working copy locally, but it has been some years since I last used it.

Do I need to upload it to a hosting service to get it working? Am I doing something wrong? I can't even get to configure the database because the installation process doesn't even start.

Thank you to anyone who can help me figure out what I'm doing wrong.

5 REPLIES 5

Re: Starting Magento on Xampp ERR_TOO_MANY_REDIRECTS

The "ERR_TOO_MANY_REDIRECTS" error typically occurs when there's a redirect loop and is often caused by misconfigurations in the server settings or the application itself. In the context of Magento on XAMPP, this could be due to incorrect configurations in the Apache or Magento settings.

 

So you should ensure that your Apache virtual host configuration for Magento is set up correctly, particularly the "DocumentRoot" and "Directory" directives. And also check Magento's base URLs configuration in the database to ensure they match your local environment.

 

You can directly update these values in the "core_config_data" table in the Magento database. If the issue persists then consider checking Magento's rewrite rules in the ".htaccess" file and ensure they are compatible with your local environment.

Re: Starting Magento on Xampp ERR_TOO_MANY_REDIRECTS

@checharor 

Hey,

Please check in core_config_data table in column like "web" in the path column and check whether all the URLs are correct or not.

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: Starting Magento on Xampp ERR_TOO_MANY_REDIRECTS

The "ERR_TOO_MANY_REDIRECTS" error you're encountering typically stems from configuration issues. It could be related to your Magento's base URL settings or incorrect server configuration in XAMPP. Check your .htaccess file for any improper rewrite rules and ensure that your base URLs in Magento's core_config_data table are correctly set for your local environment. Sometimes, modifying the 'web/secure/use_in_frontend' and 'web/unsecure/base_url' paths can resolve this issue.

While local installation issues like these can be frustrating, opting for managed Magento hosting can simplify the setup process, as it usually comes with pre-configured environments optimized for Magento, reducing installation complications.

Re: Starting Magento on Xampp ERR_TOO_MANY_REDIRECTS

Encountering "ERR_TOO_MANY_REDIRECTS" when launching Magento on Xampp? This error indicates a loop forcing your browser back and forth. Clear your browser cache and cookies. If that fails, check your Magento base URL settings in the database. Ensure it points to the correct location (e.g., http://localhost/your-magento-folder). cheap cable and internet packages This should break the redirect loop and get your Magento instance up and running.

Re: Starting Magento on Xampp ERR_TOO_MANY_REDIRECTS

Hi @checharor,

 

The "ERR_TOO_MANY_REDIRECTS" error typically indicates that there is a misconfiguration causing an infinite redirect loop. Here are some steps to troubleshoot and resolve this issue when setting up Magento on XAMPP:

 

Check Base URL Configuration:

  • Open app/etc/env.php and ensure the base_url is correctly set. For a local setup, it should be something like:
    'base_url' => 'http://localhost/magento/',
  • If this file doesn't exist yet because the installation hasn't started, ensure that the URL you are using in your browser matches the URL you plan to use for the Magento installation.

Modify .htaccess:

  • Open the .htaccess file in the root of your Magento installation directory.
  • Ensure the following lines are uncommented or added if they don't exist.
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Check Virtual Host Configuration:

  • Ensure that the Apache virtual host is configured correctly. Open the httpd-vhosts.conf file located in F:\xampp\apache\conf\extra and ensure it looks something like this:

         DocumentRoot "F:/xampp/htdocs/magento"
ServerName localhost

<Directory "F:/xampp/htdocs/magento">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

 

Disable SSL Verification (if necessary):

  • If SSL is misconfigured, it can cause redirect loops. Try to disable SSL for local development by modifying the app/etc/env.php file:

 

'http_cache_hosts' => [
    [
        'host' => 'localhost',
        'port' => '80',
    ],
],
  • Or ensure SSL URLs are not being forced in the configuration.

Database Configuration:

  • Ensure your database is set up correctly and is accessible by your application. Misconfiguration here can also sometimes lead to redirects as Magento tries to reach the database.

Clear Magento Cache:

  • Manually clear the Magento cache by deleting the var/cache, var/page_cache, and var/generation directories:
    rm -rf var/cache/* var/page_cache/* var/generation/*
  • Ensure the directories have the correct permissions for the web server to write to them.

Check File Permissions:

  • Ensure the file permissions for the Magento directory are correct. Typically, the web server user needs write access to var, pub/static, and app/etc.

Also check the core_config_data table for any incorrect URLs that might be causing the redirect loop, you need to follow these steps:

 

Access Your Database:

  • Open phpMyAdmin or your preferred MySQL client.
  • Select the database used by your Magento installation.

Check the core_config_data Table:

  • Locate and open the core_config_data table.
  • Execute the following SQL query to find all entries related to URLs:

SELECT * FROM core_config_data WHERE path LIKE 'web/%';

After checking these configurations, restart Apache and try accessing your Magento installation again.

 

If the issue will be resolved, Click Kudos & Accept as a Solution. And If you need any other issues than please let us know we would like to assist you.