0
  • I have completed the steps to update database to change the URL from http to https.

    • Then updated htacecss to add redirect rules.
    • But now anything except admin is going into endless loop of 301 redirect to itself.
    • Here is my .htaccess rules:

    RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} !^/wp-json/ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

In wp-config.php below is the configuration lines:

define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'www.example.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

Please help to point the exact cause of endless loop of redirects.

Regards, Vijay

2
  • did u clear your browser cache, 301 redirects are cached!
    – Aurovrata
    May 30, 2018 at 15:09
  • Yes, I did lots of times, also tested on vpn and private browsing modes. But it is redirecting only. May 31, 2018 at 5:10

1 Answer 1

0

Looks like there is a missing rule in your htaccess file, try

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# ensure access to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/wp-json/
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ - [L]
#ensure you can access the network dashboard too.
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wp/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wp/$2 [L]
RewriteRule . /index.php [L]

You can test your htaccess rules with this tool.

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.