IIS伪静态规则web.config让地址栏url301重定向 去掉指定的二级目录
2023-01-09 13:59:58其他网站相关知识 42人已围观
问题描述
原地址:https://www.baidu.com/html/news/1.html
新地址:https://www.baidu.com/news/1.html
网站改版后去掉了html这个目录,但是搜索引擎已经收录了很多页面,不想让这些页面成为404,想通过301自动重定向到对应的新页面。
web.config规则如下
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="二级目录301重定向到二级域名" stopProcessing="true"> <match url="^html/(.*)$" ignoreCase="false"></match> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"></conditions> <action type="Redirect" url="https://www.baidu.com/{R:1}" redirectType="Permanent"></action> </rule> </rules> </rewrite> </system.webServer> </configuration>
相关文章
随机图文
pbootcms调取当前栏目的父栏目链接
适用范围:在列表页或详情页使用 调取当前栏目的父栏目链接 {sort:parentlink}js正则表达式验证手机号码,用户名和邮箱
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>0536360.com</title> </head> <script> //对象选择器 function $sel(id,ta哀悼日 让网站全站变灰css代码
此代码为提取百度官方的css代码。 html{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);-webkit-filter:grayscale(100%);-moz-filter:grayscale(100%);-ms-filter:grayscale(100%);-o-filter:grayscale(100%)pbootcms当前位置面包屑导航中的首页改成Home
{pboot:position indextext=Home} indextext=Home标签可以将导航中的首页文字替换为Home,如需替换其他文字请自行修改。