Change the URL to URL with HTTPS

*爱你&永不变心* 提交于 2019-12-13 07:43:20

问题


I have my .htacces on my server and it looks like so:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

But when I type example.com in my browser it doesn't redirect to https://example.com. How can I do that?


回答1:


It would seem it was just the spelling of .htaccess (filename) that was the problem. This has two s, not one, as stated in the question.

Bit of an aside... the name of this file (per-directory Apache config filename) can be changed in the server config (although this is rare):

AccessFileName .htaccess


来源:https://stackoverflow.com/questions/43308525/change-the-url-to-url-with-https

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!