0

Today after installed PolyLang plugin,my wordpress site has a issue:

err_too_many_redirects

so I followed some tutorials to midfield the .htaccess file in cPanel:

before:

<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

RewriteRule ^$ https://www.ohyanlawgroup.com/home/ [L,R=301]
RewriteEngine On 
# RewriteCond %{HTTPS} off
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.ohyanlawgroup.com/$1 [R,L]

after:

# 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

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://www.ohyanlawgroup.com/ [L,R=301]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.ohyanlawgroup.com/$1 [R,L]

Now the err_too_many_redirects gone. But the website can only load part of its content, it seems all the static file has not been loaded.

Any friend can help?

William
  • 3,724
  • 9
  • 43
  • 76
  • Are you using Cloudflare's [Flexible SSL](https://support.cloudflare.com/hc/en-us/articles/200170416-End-to-end-HTTPS-with-Cloudflare-Part-3-SSL-options#h_4e0d1a7c-eb71-4204-9e22-9d3ef9ef7fef) option? – Koala Yeung Dec 03 '20 at 05:49
  • yes,there is a folder under file manager named ssl – William Dec 03 '20 at 05:51
  • What is your hosting provider? – Koala Yeung Dec 03 '20 at 05:54
  • https://gracecomputer.net/ cpanel ,I'm not sure ,this is my friend's website ,it seem's the host is a taiwan company – William Dec 03 '20 at 05:59
  • How did you setup your HTTPS site? Did you setup as HTTP site first? – Koala Yeung Dec 03 '20 at 06:00
  • Sorry I didn't set up this website I'm very new to wordpress and php. – William Dec 03 '20 at 06:02
  • Why did you remove the .htaccess lines? – Koala Yeung Dec 03 '20 at 06:04
  • RewriteRule ^$ https://www.ohyanlawgroup.com/home/ [L,R=301] RewriteEngine On # RewriteCond %{HTTPS} off RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.ohyanlawgroup.com/$1 [R,L] – William Dec 03 '20 at 06:05
  • These are another different rewrite rules. What are they for? – Koala Yeung Dec 03 '20 at 06:06
  • I'm not sure I think maybe this is the error made by the plugin – William Dec 03 '20 at 06:07
  • I cannot put everything together. Please help me to help. Can you please edit your question to show the complete before and complete after .htaccess setup? I believe this comment should belong there somewhere, right? – Koala Yeung Dec 03 '20 at 06:09
  • Thank you so much and what I have posted now ,is the complete before and complete after. – William Dec 03 '20 at 06:11
  • It's still the same as before. Have you save your edit yet? – Koala Yeung Dec 03 '20 at 06:12
  • The code inside is all the same.the only different from before and after is,after I have removed all the code outside the – William Dec 03 '20 at 06:19
  • Why did you remove them? – Koala Yeung Dec 03 '20 at 06:20
  • I have modified my code, please check, this code is following some tutorial – William Dec 03 '20 at 06:37
  • _“it seems all the static file has not been loaded.”_ - so what errors do those requests cause then - still “too many redirects” for those, or something different? – CBroe Dec 03 '20 at 08:02
  • The order of things is definitively wrong here - the external HTTPS rewrite should happen _before_ all the WP internal stuff. – CBroe Dec 03 '20 at 08:03
  • And checking `%{HTTPS} !on` and `%{SERVER_PORT} 80` both achieve pretty much the same thing, but the rules that follow each of those conditions use the exact same pattern, so only the first of those will ever happen. And on that you are completely discarding the original URL path. – CBroe Dec 03 '20 at 08:05

0 Answers0