httpbaiducom6677indexphps=ruanjie_softboxsoftsoft_detail&id=1 使用nginx伪静态 使链接变为httpbaiducom6677live_detail1html
要使用nginx伪静态将链接从"http://baidu.com:6677/index.php?s=ruanjie_softbox/soft/soft_detail&id=1"变为"http://baidu.com:6677/live_detail/1.html",您可以在nginx配置文件中添加以下规则:
location /live_detail/ { rewrite ^/live_detail/(\d+).html$ /index.php?s=ruanjie_softbox/soft/soft_detail&id=$1 last; }
这将把请求重写到原始链接的格式上,并确保正确的页面内容被加载。请确保重新加载nginx配置文件以使更改生效。
原文地址: https://www.cveoy.top/t/topic/iD8c 著作权归作者所有。请勿转载和采集!