0

I want to moving my site followourtrack.fr from http to https but i have the message ERR_TOO_MANY_REDIRECTS

wp-config.php :

define('WP_HOME','https://www.followourtrack.fr/');
define('WP_SITEURL','https://www.followourtrack.fr/');

.htaccess file :

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

I need to help

Thank you :)

1
  • Do you have any experience with WP-CLI?? Jun 11, 2019 at 15:08

3 Answers 3

0

First you must Update the Site Address under Settings > General. Make sure the address is https://www.followourtrack.fr/. After that update your .htaccess like below.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

That .htaccess can work with fine in my server.

5
  • If he is using wp-config.php to define the URLs, those settings override the values in the wp-options table. (And not a big fan of doing that, unless it is a development system, and even then...) The htaccess in the answer is fine. I'd put the rewrite rules above the 'begin/end wordpress' section, so that any permalink rewrite doesn't get rid of the ssl rewrites. Jun 11, 2019 at 17:21
  • @Rick Hellewell it's the only code in the .htaccess file
    – Valentin
    Jun 12, 2019 at 13:26
  • @ariyolo I already have Update the Site Address under Settings
    – Valentin
    Jun 12, 2019 at 13:26
  • Use the default WP recommended htaccess settings (look in the Codex). Then add your rewrite rules above the "Start WP" section. The HTTPS rewrite needs to be above the WP stuff. Remove the URL settings in wp-config.php. Make sure the wp-options table contains your site URL (in two places). Jun 12, 2019 at 16:12
  • - I deleted URL settings in wp-config.php - In the .htaccess file i placed the https redirection under the default WP recommended htaccess settings and the problem is always the same. If I delete The HTTPS rewrite the loop no longer exists but the theme is broken. (some urls http and not https)
    – Valentin
    Jun 13, 2019 at 12:40
0

Try removing the trailing slashes from the wp-config definitions, so they read:

define('WP_HOME','https://www.followourtrack.fr');
define('WP_SITEURL','https://www.followourtrack.fr');

If that fails, try removing the www from those entries:

define('WP_HOME','https://followourtrack.fr');
define('WP_SITEURL','https://followourtrack.fr');
3
  • still the same :(
    – Valentin
    Jun 12, 2019 at 13:08
  • Following from @brothman's response, you very likely have a number of http:// urls in your database (other than sitename and blogurl). As a lot of serialisation goes on in the WP database, do not attempt to find/replace them, as this will break your data. Instead, use a plugin, such as Really Simple SSL and that will do the replacing on the fly [link]( en-gb.wordpress.org/plugins/really-simple-ssl ).
    – NJMUK
    Jun 13, 2019 at 13:14
  • I tried with a plugin but the problem is always the same
    – Valentin
    Jun 25, 2019 at 14:59
0

edit your mysql database directly and change sitename and blogurl (both of which are in the wp_options table) and change them both to 'https://www.followourtrack.fr'

1
  • I did it but it's still the same
    – Valentin
    Jun 12, 2019 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.