1
试图去HTTPS,但是当我用下面我.htaccess
我得到重定向问题错误从http不正确重定向到HTTPS
这里是我在我的.htaccess
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP} on [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} https [OR]
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
#Uncomment lines below when uploading to the live server
RewriteCond %{HTTP_HOST} !^(www\.)example\.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^.*$ index.php [QSA,L,NC]
#Uncomment lines below when uploading to the live server
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https://(www\.)?example.com/.*$ [NC]
RewriteRule \.(gif|jpg|png|tif|js|css|xls|xlsx|zip|rar|pdf|ods|ots)$ - [F]
请帮助
如果可以的话,请考虑你的方法来定义重定向,如果你可以避免使用.htaccess,并且更好地在virtualhsot中定义它的大部分。大多数情况下,重定向到ssl涉及定义合适的虚拟主机和简单的Redirect/https://主机名/,request_filename检查然后转到index.php,都可以删除单个Fallbackresource指令等等。 –