htaccess的问题强制SSL [英] .htaccess issue to force SSL

查看:194
本文介绍了htaccess的问题强制SSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对我的一个网站(基于字preSS)激活SSL和要修改的.htaccess 修改内容的链接为https。
我的意思是,到 https://www.example.com/products.html 页面是一个 http://example.com/blah-blah .JPG
我想把它通过的.htaccess 更改为 https://www.example.com/blah-blah.jpg 和我没有任何想法! :|
我安装和激活 HTTPS的Word preSS 插件,但一些链接不更改为https。

I activated SSL on one of my sites (based on wordpress) and want to modify .htaccess to modify content's links to https.
I mean, into https://www.example.com/products.html page is a http://example.com/blah-blah.jpg
i want to change it to https://www.example.com/blah-blah.jpg via .htaccess and i don't have any idea! :|
I installed and activated HTTPS for WordPress plugin but some links not change to https.

推荐答案

先生。舒尔曼的解决方案忘记了域名之后的斜线,这样用户会被重定向到 的https:// WWW .example.comcategory / CAT1 / CAT2 / 这是不完全正确。我加了一个斜线给他的.htaccess项,和它的工作就好了。试想一下:

Mr. Schulman's solution forgets the slash after the domain name, so the user is redirected to https://www.example.comcategory/cat1/cat2/ which is not quite right. I added a slash to his .htaccess entry, and it worked just fine. Consider:

RewriteCond %{HTTPS} off
RewriteRule (.*)  https://example.com/$1 [R]

这篇关于htaccess的问题强制SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆