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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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]
回答2:
Try putting this in .htaccess
:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.example.com$1 [R]
Of course this will require that you have mod_rewrite enabled.