Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

create clean url for member or user page

Go to End

6 Posts   1077 Views


Community Member, 9 Posts

28 October 2012 at 9:32pm

Edited: 28/10/2012 9:33pm

I really need help for my projects.
Introduce, I've been using silverstripe for about 4 years.
I also had searching of this question but still cant find the answer.

I want to make clean url for member/user page, from:


Should I edit the .htaccess or using $url_handlers on my Page Controller?

Thx and Regards,
Silverstripe Developer from Indonesia


Community Member, 9 Posts

29 October 2012 at 5:18pm

anyone? :)


Forum Moderator, 5523 Posts

2 November 2012 at 11:42am

Edited: 02/11/2012 11:44am

Unless you knew all the member users and hard coded each in your .htaccess, the best method is to use a custom handleAction() method to check for a member of that username (

I should clarify, don't edit that file directly. You can create your custom handleAction in Page_Controller (and use parent::handleAction() to refer to the original function)


Community Member, 9 Posts

2 November 2012 at 3:11pm

Edited: 02/11/2012 3:13pm

Hi Willr,

Thx for your answer.
I've tried that, but still doesn't work.

in the first line of handleAction method:

foreach($request->latestParams() as $k => $v) {
    if($v || !isset($this->urlParams[$k])) $this->urlParams[$k] = $v;

for example if the URL is:
if we debug the $request or $request->latestParams(), we will never get value of "adam"
$request->latestParams() will return: Action = NULL, ID = NULL, OtherID = NULL


Community Member, 187 Posts

2 November 2012 at 10:21pm

Edited: 02/11/2012 10:50pm


I've just been testing this on a site I'm building where I need to remove 'view' from '', in handleAction(), the info I needed ('example-project') was found by doing:


For your example, I believe SilverStripe will think that 'adam' is the action, so you can then check for the existence of a user, then if they don't exist simply call parent::handleAction();


Sorry I've just re-read your post and you aren't getting an action returned. I don't know if it acts differently as you're trying to get the request from the home page, do you have any URL handlers set up or anything that could possibly affect it?


Community Member, 9 Posts

3 November 2012 at 4:32am

Hi kinglozzer,
thx for your answer.

I already knew and i already re-tested your example on my project, still doesn't work.
Your answer is working on the other page except home.
- => "URLSegment" = about, "Action" = adam
- => "URLSegment" = NULL, "Action" = NULL
Can you check again on your project in the home URL?

What i want is:
-, not
- "example-project" is dynamic value, not some of Page / Page Controller
- "projects" is Page / Page Controller and I don't need that

Thx anyway :)