Redirect 网站需要从http转换为https重定向

Redirect 网站需要从http转换为https重定向,redirect,https,Redirect,Https,我在一个网站上工作,我使用SSL证书保护了它。Https:在手动输入时工作。它显示无错误且具有安全图标。但是,如果我们输入example.co.uk,它会将其指向http:而不使用安全密钥 我只是想知道我是否可以做一个简单的重定向?这是我们目前在.htaccess中设置的重定向。我在这里添加了什么来重定向到http:to Https:// Options +FollowSymLinks RewriteEngine on RewriteBase / # Redirect non www. to

我在一个网站上工作,我使用SSL证书保护了它。Https:在手动输入时工作。它显示无错误且具有安全图标。但是,如果我们输入example.co.uk,它会将其指向http:而不使用安全密钥

我只是想知道我是否可以做一个简单的重定向?这是我们目前在.htaccess中设置的重定向。我在这里添加了什么来重定向到http:to Https://

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# Redirect non www. to www.
RewriteCond %{HTTP_HOST} !^www\.example-direct\.co\.uk
RewriteRule (.*) http://www.example-direct.co.uk/$1 [R=301,L]

# Remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1? [R=301,L]

# Remove .php ONLY if requested directly
RewriteCond %{THE_REQUEST} (\.php)
RewriteRule ^(.+)\.php /$1 [R=301,L,QSA]

RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php

我的网站不在Wordpress中,我只需要一个修复程序,这样如果有人输入,它就会将他们重定向到我的网站不在Wordpress中,我只需要一个修复程序,这样如果有人输入,它就会将他们重定向到我的网站