I have a Wordpress site that works perfectly well in development (at mysite.dev
), however when I deploy it to my remote server (mysite.com
) it throws the 'This webpage has a redirect loop' error.
I can see in the loading bar that the browser is trying www.mysite.com then mysite.com then www.mysite.com again and again, however I'm not sure if this is relavant or not.
If my Wordpress database configuration is incorrect, I get the Error establishing a database connection message, however when everything is set correctly it breaks in this re-direct loop thing.
I have changed the field in the database (siteurl
) to reflect the remote settings (http://mysite.com/wordpress
).
Note: My wordpress files are stored in a folder called wordpress
in my root directory except for wp-config.php
, index.php
and .htaccess
.
Any ideas?
.htaccess contents:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
index.php:
<?php
/**
* @package WordPress
*/
define('WP_USE_THEMES', true);
require('./wordpress/wp-blog-header.php');
?>
My hosted server settings were forcing mysite.com to www.mysite.com and this was causing the problem. I turned this setting off and everything works now, i'd still like to know how to make it work with this setting turned on, though!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With