温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

nginx伪静态规则怎么定义

发布时间:2022-03-22 17:28:31 来源:亿速云 阅读:153 作者:iii 栏目:web开发

这篇文章主要介绍了nginx伪静态规则怎么定义的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇nginx伪静态规则怎么定义文章都会有所收获,下面我们一起来看看吧。

1、nginx伪动态划定规矩

rewrite ^(.*)/tags.html $1/tags.php;
rewrite ^(.*)/tags/(.*)-1.html $1/tags.php?/$2/$3;

rewrite ^([^\.]*)/tags.html $1/tags.php;
rewrite ^([^\.]*)/tags/(.*)-([0-9]+).html $1/tags.php?/$2/$3;

2、.htaccess文件伪音讯规定

RewriteBase / 
RewriteRule ^tags\.html$ /tags.php$1 
RewriteRule ^tags/(.*)-([0-9]+).html$ /tags.php?/$1/$2

3、IIS下网站.config文件,伪消息规则:

<rule name="Imported Rule tags 1">
<match url="^(.*/)*tags.html$" ignoreCase="false" />
<action type="Rewrite" url="{R:1}/tags.php" />
</rule>

<rule name="Imported Rule tags 2"> <match url="^(.*/)*tags/([^-]+)-([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="{R:1}/tags.php\?/{R:2}/{R:3}" appendQueryString="false" /> </rule>

4、httpd.ini 文件伪动态规定

RewriteRule ^(.*)/tags\.html $1/tags\.php 
RewriteRule ^(.*)/tags/(.*)-([0-9]+).html $1/tags\.php\?$2/$3

关于“nginx伪静态规则怎么定义”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“nginx伪静态规则怎么定义”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注亿速云行业资讯频道。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI