使用HTTPS而不是HTTP [英] Using HTTPS instead of HTTP

查看:124
本文介绍了使用HTTPS而不是HTTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用户必须登录的网站。我想使用HTTPS,所以建立一个到服务器的安全加密连接来检查用户名和密码。

I have a website that user have to loggin to. I want to use HTTPS so make a secure encrypted connection to the server to check the user name and password.

目前我的服务器上有一个名为httpdocs的文件夹,这是我的网站在哪里存储,我也有一个名为httpsdocs的文件夹。

Currently on my server i have a folder called httpdocs, this is where my website is store, i also have a folder called httpsdocs.

现在我说我的网站存储在httpdocs中,所以逻辑上我会去 http://website.com

Now as i stated my website is stored in httpdocs so logically i would go to http://website.com

但我发现如果我去 https://website.com 我可以安全地连接存储在httpdocs中的页面。

But i found that if i go to https://website.com i get a secure connect to the pages stored in httpdocs.

无论如何,我的问题是,无论何时我去另一个链接,我都会松开安全连接(URL会回到http://)那么我如何保证它的安全呢?我是否必须在href中使用完整的URL,因为这似乎有点蹩脚而不是仅使用href = page2.php。

Anyway, my question is, whenever i go to another link i loose the secure connect (URL goes back to http://) So how do i keep it all secure? Would i have to use the full URL in the href because that seems a bit lame instead of just using href=page2.php .

我是网站的新区域开发,但我在开发方面经验丰富,如果有帮助的话。

I'm new this area of website developing, but i am experienced in developing if that helps you.

非常感谢帮助。

如果有人知道任何好事,一些基本教程或阅读材料会很棒吗?

Some basic tutorials or reading material would be awesome if anyone knows of anything good?

再次感谢。

推荐答案

要在评论中回答你的问题,你应该使用mod_rewrite(假设它已启用):

To answer your question in the comments you should use mod_rewrite (assuming its enabled):

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

会将任何网页发送到https。

that will send any webpage to https.

这篇关于使用HTTPS而不是HTTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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