用浏览器访问 http://www.fzr.com/100-200-100.html 或 http://www.fzr.com/100-100-100.html 跳转到http://www.fzr.com页面
4.4.2 实例操作:基于参数匹配的跳转
(1)修改配置文件

文章插图

文章插图

文章插图
(2)浏览器访问测试

文章插图

文章插图
4.5基于目录下所有 php 结尾的文件跳转要求访问 http://www.fzr.com/upload/123.php 跳转到首页 。
4.5.1 基于目录下所有 php 结尾的文件跳转的操作步骤
vim /usr/local/nginx/conf/nginx.confserver { listen 80; server_name www.fzr.com; #域名修改 charset utf-8; access_log /var/log/nginx/www.fzr.com-access.log main; location ~* /upload/.*\.php$ { rewrite (.+) http://www.fzr.com permanent; } location / { root html; index index.html index.htm; }}systemctl restart nginx浏览器访问 http://www.fzr.com/upload/888.php 跳转到http://www.fzr.com页面 。4.5.2 实例操作:基于目录下所有 php 结尾的文件跳转
(1)修改配置文件

文章插图

文章插图

文章插图
(2)浏览器访问测试

文章插图

文章插图
4.6基于最普通一条 url 请求的跳转要求访问一个具体的页面如 http://www.fzr.com/abc/888.html 跳转到首页
4.6.1 基于最普通一条 url 请求的跳转的操作步骤
vim /usr/local/nginx/conf/nginx.confserver { listen 80; server_name www.fzr.com; #域名修改 charset utf-8; access_log /var/log/nginx/www.fzr.com-access.log; location ~* ^/abc/888.html { rewrite (.+) http://www.fzr.com permanent; } location / { root html; index index.html index.htm; }}systemctl restart nginx浏览器访问 http://www.fzr.com/abc/888.html 跳转到http://www.fzr.com页面 。4.6.2 实例操作:基于最普通一条 url 请求的跳转
(1)修改配置文件

文章插图

文章插图
经验总结扩展阅读
- 2023食品科学与工程类热门专业有哪些 就业前景怎么样
- 2023自然保护与环境生态类热门专业有哪些 比较好的专业
- 2023公共卫生与预防医学类热门专业有哪些 比较好的专业
- 2023管理科学与工程类热门专业有哪些 比较好的专业
- 丙火与辛金灵魂伴侣 五行无克运势提升
- 练大腿的方法 练大腿的方法都有哪些
- 谁最喜欢甲木女 与丁火男白首不分离
- 甲木男喜欢女生类型 外在与内在并存
- 雄黄粉驱蛇怎么用
- 蒜薹与蒜苔哪个正确
