所以我的问题是如果我访问我的网站它是不安全的。但是,如果我放https://www.websitename.co.uk,它将显示带有https和安全栏的网站。但是,当我上传我的htaccess文件时,网站并不想连接。
如果我从htaccess文件中注释掉下面的代码,那么该网站可以正常运行,但不会显示安全性。如果我添加该代码,它只是给我错误消息,如图中所示。
# Redirect http to https editor nathan 18/01/2017
#RewriteEngine On
#RewriteCond %{HTTPS} off
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
htaccess文件
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteBase /
# Redirect http to https editor nathan 18/01/2017
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Redirect non www. to www.
RewriteCond %{HTTP_HOST} !^www\.MYWEBSITE\.co\.uk
RewriteRule (.*) http://www.MYWEBSITE.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
答案 0 :(得分:0)
请更改此行:
menu.xml
进入这个:
marked as duplicate
这意味着如果访问者转到http(即端口80)将重定向到https(这是443)