目前访问的地址是:https://xxx.xxx.xx.com/de/support/how-to/troubing/?id=213232
想要隐藏掉troubing这个目录,用 https://xxx.xxx.xx.com/de/support/how-to/id=213232
要去掉troubing/?这一截
请问用nginx或者apache怎么实现?
2条回答 默认 最新
- asdf3301 2019-05-05 06:54关注
访问https://xxx.xxx.xx.com/de/support/how-to/id=213232
返回https://xxx.xxx.xx.com/de/support/how-to/troubing/?id=213232 的内容nginx:
location ^~ /de/support/how-to/ { rewrite ^(.*)/([^/]*)$ $1/troubing/?$2 break; } #配置要放在 location / 前面
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决评论 打赏 举报无用 1