15621857753

WIN IIS8 非www301跳到www http301跳到https

来源:齐鲁建站 栏目:开发教程 阅读: 日期:2021-07-12

本文介绍了WIN IIS8 非www301跳到www http301跳到https,注意是WINDOWS+IIS8环境,文章最后直接给出.htaccess,下载直接使用就可以了。

下面就由齐鲁建站小编和大伙儿说说WIN IIS8 非www301跳到www http301跳到https的方法。

代码直接复制到.htaccess文件里使用就可以了。

一、PHPCMS伪静态

RewriteEngine On
RewriteRule ^(.*)content-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/index\.php\?m=content&c=index&a=show&catid=$2&id=$3&page=$4
RewriteRule ^(.*)show-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/index\.php\?m=content&c=index&a=show&catid=$2&id=$3&page=$4
RewriteRule ^(.*)list-([0-9]+)-([0-9]+).html$ $1/index\.php\?m=content&c=index&a=lists&catid=$2&page=$3
RewriteRule ^tag-(.*)-([0-9]+).html index.php?m=content&c=tag&a=lists&tag=$1&page=$2

二、非www301跳到www

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.why114.com$ [NC]
RewriteRule ^(.*)$ http://www.why114.com/$1 [L,R=301]

三、http301跳到https

RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

.htaccess下载:点击下载

展开