admin管理员组

文章数量:1318564

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 4 years ago.

Improve this question

Anyone who can guide me in this matter, I want to resolve the redirect chain?

  • redirect to
  • and then redirect to .

I want to redirect directly from to .

Redirection plugins in WordPress are not working, as they are only worked with to redirect pages or posts.

This is a redirection code in .htaccess.

# BEGIN rlrssslReallySimpleSSL rsssl_version[3.3.5]
<IfModule mod_rewrite.c>
RewriteEngine on RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteCond %{REQUEST_URI} !wp-content\/cache\/(all|wpfc-mobile-cache)
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# END rlrssslReallySimpleSSL
Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 4 years ago.

Improve this question

Anyone who can guide me in this matter, I want to resolve the redirect chain?

  • http://www.example
  • redirect to https://www.example
  • and then redirect to https://example.

I want to redirect directly from http://www.example to https://example.

Redirection plugins in WordPress are not working, as they are only worked with to redirect pages or posts.

This is a redirection code in .htaccess.

# BEGIN rlrssslReallySimpleSSL rsssl_version[3.3.5]
<IfModule mod_rewrite.c>
RewriteEngine on RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteCond %{REQUEST_URI} !wp-content\/cache\/(all|wpfc-mobile-cache)
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# END rlrssslReallySimpleSSL
Share Improve this question edited Oct 20, 2020 at 12:23 Rup 4,4004 gold badges29 silver badges29 bronze badges asked Oct 20, 2020 at 11:17 SubhanSubhan 11 bronze badge 12
  • 1 Can you show us how your redirects are configured? Are both redirects generated by WordPress, or is one in your web server configuration? I see you've tagged this .htaccess. – Rup Commented Oct 20, 2020 at 11:36
  • "they are only worked with to redirect pages or posts" - What do you mean by this? Aside: The redirect "chain" you describe isn't necessarily a bad thing and in some cases is actually recommended/required. – MrWhite Commented Oct 20, 2020 at 11:41
  • How are those redirects implemented? – Tom J Nowell Commented Oct 20, 2020 at 11:46
  • @Rup actually, I don't know the location of this problem. I have set example in the site Address setting(WordPress). This is a redirection code in .htaccess.# BEGIN rlrssslReallySimpleSSL rsssl_version[3.3.5] <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"' RewriteCond %{REQUEST_URI} !wp-content\/cache\/(all|wpfc-mobile-cache) RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] </IfModule> # END rlrssslReallySimpleSSL – Subhan Commented Oct 20, 2020 at 12:07
  • 1 @Subhan Please edit your question to add the contents of your .htaccess file in order to retain formatting. (Comments are not for code dumps.) – MrWhite Commented Oct 20, 2020 at 12:11
 |  Show 7 more comments

1 Answer 1

Reset to default 1
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

Replace %{HTTP_HOST} with your canonical hostname. For example:

RewriteRule ^(.*)$ https://example/$1 [R=301,L]

You will need to clear your browser cache before testing.

本文标签: htaccessI want to resolve Redirect Chain