请教个url重定向的问题

例如,在本站中访问

https://laravist.com/article/19 将会跳转到

https://www.laravist.com/blog/post/deploy-laravel-app-on-ubuntu-vps

想请教一下,这样的后台逻辑是怎么实现的

articles 表记录 slug 值:deploy-laravel-app-on-ubuntu-vps

再在控制器 show($id) 跳转 showWithSlug($slug) 就是了。

JellyBool

articles 表记录 slug 值:deploy-laravel-app-on-ubuntu-vps

再在控制器 show(id) 跳转 showWithSlug(slug) 就是了。

TenYear 回复 JellyBool

嗯,那这样的话,就是以 slug 做为索引,来获取 articles 吗?

JellyBool 回复 TenYear

恩。我这边是这样的

TenYear 回复 JellyBool

嗯,好的,明白了。 谢啦。