英文:
In silverstripe Can we create Vanity URL for the member profile?
问题
在SilverStripe中,我们是否可以为会员个人资料创建类似"mydomain.com/john-doe"的虚拟URL?
我尝试通过routes.yml来实现,但这会破坏其他URL,如管理页面和其他前端页面(关于我们)。
英文:
In silverstripe Can we create Vanity URL for the member profile like "mydomain.com/john-doe"?
I tried to do it via the routes.yml but it is breaking the other URLs like admin and other frontend pages(about us).
答案1
得分: 1
Yes, though there's no simple yaml configuration for doing so.
The easiest way to do this is probably with the silverstripe/redirectedurls module which gives you a section in the CMS for setting arbitrary URL redirections.
If that doesn't quite do what you're after, you could set up VirtualPages for each such page - though that will clutter your sitetree somewhat (which you could alleviate by hiding those from the sitetree and setting up a custom ModelAdmin for managing them).
英文:
Yes, though there's no simple yaml configuration for doing so.
The easiest way to do this is probably with the silverstripe/redirectedurls module which gives you a section in the CMS for setting arbitrary URL redirections.
If that doesn't quite do what you're after, you could set up VirtualPages for each such page - though that will clutter your sitetree somewhat (which you could alleviate by hiding those from the sitetree and setting up a custom ModelAdmin for managing them).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论