In silverstripe Can we create Vanity URL for the member profile?

51 Views Asked by At

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

There are 1 best solutions below

0
Guy Sartorelli On

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).