Link to home
Start Free TrialLog in
Avatar of Katie Garcia
Katie Garcia

asked on

WordPress Redirect Loop - CPanel Hosting

Hey,

I have been tasked of migrating a WordPress solution from one server to another, this is the first time I've had to do anything like this so I followed multiple guides on the import processes and what I needed to change in each config file to get it working, however upon setting the database up and placing all the files in and making what little changes were needed I am met with

This web page has a redirect loop

ERR_TOO_MANY_REDIRECTS
In Chrome

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies.

In Firefox

And

This page can’t be displayed

•Make sure that the web address http://***.co.uk is correct.
•Look for the page with your search engine.
•Refresh the page in a few minutes.

For internet explorer

.htaccess File Contents
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^assets/(.*) /wp-content/themes/roots/assets/$1 [QSA,L]
RewriteRule ^plugins/(.*) /wp-content/plugins/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
AddType text/x-component .htc
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# Or, compress certain file types by extension:
<files *.html>
SetOutputFilter DEFLATE
</files>

Open in new window


index.php Contents
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );

Open in new window


wp-config.php
<?php
/**
 * The base configurations of the WordPress.
 *
 * This file has the following configurations: MySQL settings, Table Prefix,
 * Secret Keys, WordPress Language, and ABSPATH. You can find more information
 * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
 * wp-config.php} Codex page. You can get the MySQL settings from your web host.
 *
 * This file is used by the wp-config.php creation script during the
 * installation. You don't have to use the web site, you can just copy this file
 * to "wp-config.php" and fill in the values.
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', ******');

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

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

/** 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', '');


/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         '****');
define('SECURE_AUTH_KEY',   '****');
define('LOGGED_IN_KEY',     '****');
define('NONCE_KEY',         '****');
define('AUTH_SALT',        '****');
define('SECURE_AUTH_SALT', '****');
define('LOGGED_IN_SALT',    '****');
define('NONCE_SALT',       '****');
/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each a unique
 * prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_';

/**
 * WordPress Localized Language, defaults to English.
 *
 * Change this to localize WordPress. A corresponding MO file for the chosen
 * language must be installed to wp-content/languages. For example, install
 * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
 * language support.
 */
define('WPLANG', '');

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 */
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
	define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

Open in new window



I have attempted to add to the end of the config file but that didn't yield any luck,

define('WP_HOME','http://***.com');
define('WP_SITEURL','http://***.com');

Open in new window


I have checked to make sure that the site URL is correctly present within the database, I have double and triple checked all of the username details with no luck. I've renamed the plugin folder to disable plugins and that also yielded no results, I have tried in multiple browsers just to make sure that wasn't a problem and I've also tried with www. instead of straight HTTP:// for all links.

I am hoping that this is something stupid I've done and it could be an easy fix, but right now I'm running out of ideas of what to try. I have also used a straight install of WordPress with the same result through that URL.

Additional Notes:
The website is stored within public_html of the root of the hosting file manager
The URL loads correctly with a place holder index.html added
wp-admin URL yields the same result with a redirect loop
I am using HostingUK as my hosting solution

If anyone is able to help on this situation in any capacity that would a great help, I'm sorry if I'm a bit vague on certain details but if you require any more information please feel free to ask.

Thanks for taking your time to read this question

Katie
Avatar of Robert Granlund
Robert Granlund
Flag of United States of America image

Make a copy of your .htaccess file.  Then, remove this part:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^assets/(.*) /wp-content/themes/roots/assets/$1 [QSA,L]
RewriteRule ^plugins/(.*) /wp-content/plugins/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Open in new window

See what happens when you do that.  Also, in your hosting control panel, was there a re-direct setup for the new site?  That may be causing an issue.
Avatar of Katie Garcia
Katie Garcia

ASKER

Hey there rgranlund,
Thanks a bunch of the very quick reply! I removed that section from the .htcaccess file and sadly there was no chance for either the basic URL or getting into the admin login section of the site, both resulted in a redirect loop error once more.

Currently there are no Redirects set up in the hosting control panel either.
Avatar of Lucas Bishop
Does the redirect loop occur when you visit both of these addresses via your browser:
http://example.com
http://www.example.com
?
Yeah sadly both URLs give the Redirect Loop errors and appropriate error messages from the various browsers.
SOLUTION
Avatar of Lucas Bishop
Lucas Bishop
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm embarrassed to say I don't know, pretty much everything I've learnt about it has been in the past few days, I was given very little details sadly! Where can I check this? And I thank you so much for the extremely quick help.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
wp-includes/version.php Contents
<?php
/**
 * The WordPress version string
 *
 * @global string $wp_version
 */
$wp_version = '3.7';

/**
 * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
 *
 * @global int $wp_db_version
 */
$wp_db_version = 25824;

/**
 * Holds the TinyMCE version
 *
 * @global string $tinymce_version
 */
$tinymce_version = '359-20131018';

/**
 * Holds the required PHP version
 *
 * @global string $required_php_version
 */
$required_php_version = '5.2.4';

/**
 * Holds the required MySQL version
 *
 * @global string $required_mysql_version
 */
$required_mysql_version = '5.0';

Open in new window

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No new page redirection, it gives be a root of example.co.uk, no HTTP before it, roots directly to the base URL with the Redirect Loop browser display message.

There was also no https indications in any of the wp_Options rows or any config files.

Sorry for being such a pain!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial