-
-
Save nurtext/b6ac07ac7d8c372bc8eb to your computer and use it in GitHub Desktop.
# Let apache know we're behind a SSL reverse proxy | |
SetEnvIf X-Forwarded-Proto "https" HTTPS=on | |
# Redirect to HTTPS | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTPS} !=on | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC] | |
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
</IFModule> |
i have a nginx that reverse proxy wordpress by https
the wordpress is running by an docker with apache2 inside
but now it redirect between http and https, how to turn off redirect?
is can be a couple of reasons you need to be more specific.
Do you use Nginx? cPanel? Plesk? Engintron on cPanel?
I can tell you this code is effective for people who have NGINX and reverse proxy.
and I don't gonna lie if you have cPanel has the big chance this code is not recommended anymore.
cPanel design himself (APACHE as well) with new features with an interface (like windows not work on DOS anymore and when you compile it you actually need to do it from the interface).
if you work on the cloud, ssh, and individual WordPress standalone is a little different.
@crapthings
if you use cPanel is be easier to help you, btw good to know for you:
https://support.cpanel.net/hc/en-us
if you have cPanel (even from the hosting is no matter)
connect to the link they are able to help you,
if you have something also like Plesk, cPanel Engintron, stuff like this, more than here I will try help you.
@Dzhuneyt
you genius hhh:
https://developer.wordpress.org/reference/functions/is_ssl/