Redirect loop error on wordpress landing page on localhost

I am trying to run a local version of a live WordPress site, however, after setting up the local environment and attempting to access:

http://localhost/wordpress/ 

I receive the following error:

Read More
This webpage has a redirect loop
The webpage at http://localhost/wordpress/ has resulted in too many redirects.
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

Whilst I cannot visit the site, I am able to access the dashboard for the site locally at:

http://localhost/wordpress/wp-admin/

I have been trying to fix this for many hours, and have had another wordpress expert (who already runs a local version of the same site) spend 2 hours hashing through this with me. No luck. I would appreciate any help. As hopefully useful background:

To run the local version I installed MAMP, and both the MySQL and Apache server are green. I have placed a copy of all the site files in MAMP/htdocs/wordpress. I have exported the site database as an .sql file, created a new database in the phpmyadmin page loaded through MAMP, and imported the .sql file.

I have also updated the config.php file to have the following details:

define('DB_NAME', 'database_name');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', 'root');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

I have also changed all the wordpress urls to run off localhost:80/wordpress through a SQL find and replace statement.

My .htaccess file contains the following:

# BEGIN WordPress

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.+)$ /index.php/$1 [NC,L,QSA]
</IfModule>

# END WordPress

All of this setup yields the error when trying to view

If anyone requires any further information or any of the above is not clear, I will be happy to provide. Thanks in advance for any help.

Related posts

4 comments

  1. I for instance have MAMP pro running with custom development URLs like project.dev. When I created the one-click installation of WordPress through MAMP, it automaticly entered the port-number into WordPress as well. I don’t think WordPress likes when the port-number is :80 which is standard. Removing the port-number from WordPress Address and Site Address did the trick in my case.

  2. As I was moving from Windows environment to Mac OS probably on the copy files i was missing the install.php file. And when i tried to install the theme it would bring me the redirect loop screen.

    It was confusing to me because I was following all steps at the end I went to look for the install.php and saw it was missing there put it in the place and voila!

    Maybe will help i don’t know, for the next readers to come!

  3. In your web browser, try deleting cookies for your local domain รขย€ย” in this case “localhost”

  4. I had the same problem, and my solution was to disable the language plugin (in my case polylang), and to reenable it.
    It’s logic that it automatically changes some links that are not declared in the database. (my guess).
    Anyway it worked! ๐Ÿ˜€

Comments are closed.