描述:LAMP或者LNMP集成环境跳转:首先在网站根目录下创建.htaccess文件,如果目录下已经有.htaccess文件,则用vi或者其他编辑器打开,在最下面添加写入如下语句即可RewriteEngine onRewriteBase /RewriteCond %{SERVER_PORT} !^443$…
LAMP或者LNMP集成环境跳转:
首先在网站根目录下创建.htaccess文件,如果目录下已经有.htaccess文件,则用vi或者其他编辑器打开,在最下面添加写入如下语句即可
RewriteEngine onRewriteBase /RewriteCond %{SERVER_PORT} !^443$RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]RewriteEngine on RewriteBase / RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]RewriteEngine onRewriteBase /RewriteCond %{SERVER_PORT} !^443$RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
Apache服务器:
如果需要整站跳转,则在网站的配置文件的<Directory>标签内,键入以下内容:
RewriteEngine onRewriteCond %{SERVER_PORT} !^443$RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]RewriteEngine onRewriteCond %{SERVER_PORT} !^443$RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]
如果对某个目录做https强制跳转,则复制以下代码:
RewriteEngine onRewriteBase /yourfolderRewriteCond %{SERVER_PORT} !^443$#RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]RewriteEngine on RewriteBase /yourfolder RewriteCond %{SERVER_PORT} !^443$ #RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R] RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]RewriteEngine onRewriteBase /yourfolderRewriteCond %{SERVER_PORT} !^443$#RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
Nginx服务器:
在配置80端口的文件里面,写入以下内容即可。
server {listen 80;server_name localhost;rewrite ^(.*)$ https://$host$1 permanent;location / {root <a target="_blank" href="https://123vo.cn/tag/31.html" title="View all posts in html">html</a>;index index.html index.htm;}server { listen 80; server_name localhost; rewrite ^(.*)$ https://$host$1 permanent; location / { root <a target="_blank" href="https://123vo.cn/tag/31.html" >html</a>; index index.html index.htm; }server {listen80;server_namelocalhost;rewrite ^(.*)$ https://$host$1 permanent;location / {roothtml;indexindex.html index.htm;}
JS跳转:
以下方法较适合指定某一个子页单独https,如果网页定义了top或者boot文件,可以在这个文件里面加入;
在需要强制为https的页面上加入以下代码进行处理http–>https
<script type="text/<a target="_blank" href="https://123vo.cn/tag/35.html" >javascript</a>">var url = window.location.href;if (url.indexOf("https") < 0) {url = url.replace("http:", "https:");window.location.replace(url);}</script><script type="text/<a target="_blank" href="https://123vo.cn/tag/35.html" >javascript</a>"> var url = window.location.href; if (url.indexOf("https") < 0) { url = url.replace("http:", "https:"); window.location.replace(url); } </script><script type="text/javascript">var url = window.location.href;if (url.indexOf("https") < 0) {url = url.replace("http:", "https:");window.location.replace(url);}</script>
PHP跳转:
添加在网站php页面内
<?phpif ($_SERVER["HTTPS"] <> "on"){$xredir = "https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];header("Location: ".$xredir);}?><?php if ($_SERVER["HTTPS"] <> "on") { $xredir = "https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; header("Location: ".$xredir); } ?><?php if ($_SERVER["HTTPS"] <> "on"){$xredir = "https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];header("Location: ".$xredir);}?>
pbootcms内核开发的网站模板,该模板适用于微信小程序网站、软件开发网站等企业,当然其他行业也可以做,只需要把文字图片换成其他行业的即可;PC+WAP,同一个后台,数据即时同步,简单适用!附带测试数据!友好的seo,所有页面均都能完全自定义标题/关键词/描述,PHP程序,安全、稳定、快速;用低成…
(PC+WAP)粉色家政服务公司网站模板 月嫂保姆网站源码下载pbootcms内核开发的网站模板,该模板适用于家政服务公司网站、月嫂保姆网站等企业,当然其他行业也可以做,只需要把文字图片换成其他行业的即可;PC+WAP,同一个后台,数据即时同步,简单适用!附带测试数据!友好的seo,所有页…
(PC+WAP)红色火锅加盟网站pbootcms模板 餐饮美食网站源码下载pbootcms内核开发的网站模板,该模板适用于火锅加盟网站、餐饮美食网站等企业,当然其他行业也可以做,只需要把文字图片换成其他行业的即可;PC+WAP,同一个后台,数据即时同步,简单适用!附带测试数据!友好的seo,所有页面…
本套织梦模板采用织梦最新内核开发的模板,这款模板使用范围广,不仅仅局限于一类型的企业,政府部门、单位机构类的网站都可以用该模板。你只需要把图片和文章内容换成你的即可,颜色都可以修改,改完让你耳目一新的感觉!布局规整,利于用户体验,手工书写DIV+CSS,代码精简。同一个后台管理 三网合一简…
1.更新下载类目的采集 及 导入网站程序:jizhiCMS + 高仿新版某刀资源网模板采集程序:蓝天采集 + 已对接好资源站规则网站图片及蓝天采集规则安装教程在下面⬇⬇⬇⬇⬇⬇⬇ 链接:https:/…
简介:104套官网源码静态html页面APP下载页面HTML源码,多年收藏精品HTML官网源码104套所有行业均可修改使用。人工精选源码每一套都是精品,纯静态页面无后台下载连接(复制直接下载)https://wp.123vo.cn/index/share/code/jq2ENvLPb1内容看完了…