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.

Archive /

Our old forums are still available as a read-only archive.

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

Removal of /home redirection

Go to End

8 Posts   2474 Views


Community Member, 4 Posts

10 May 2007 at 8:21pm

I created patch that disables primary redirection for site from
"" to ""
and if someone tries to get or will be redirected to

Patch location:



Community Member, 201 Posts

11 May 2007 at 12:51pm

Edited: 11/05/2007 12:53pm

Thanks for this Boris - Andrew, can you please make sure this finds its way into the main branch :-)


Community Member, 231 Posts

16 May 2007 at 12:23pm

Applied :)


Google Summer of Code Hacker, 222 Posts

17 May 2007 at 8:36am

Nice patch Boris!

It looks like 1 line was left out of this patch when it was applied and I get this error:
"Notice: Undefined variable: surl in /var/www/silverstripe/sapphire/main.php on line 110"

This 1 line patch adds in the missing line to fix the error and make the redirection work:


Community Member, 231 Posts

28 May 2007 at 1:47pm

Added the missed line. Cheers :)


Administrator, 690 Posts

6 June 2007 at 11:46am

I didn't like the fact that this patch added a lot of code to main.php that was replicating code in RootURLController and Director. So I've patched SVN so that ContentController calls a new method called RootURLController::should_be_on_root($currentPage) to decide when to redirect from home/ to /.

It fixed some bugs with the system that were breaking on my local dev environment, and it also will now redirect home/?getvar=1 to /?getvar=1.

It doesn't redirect if there's an action (home/something) or post variables. It makes use of $controller->urlParams prepared by the director, rather than processing $_GET['url'] itself.

Decisive Flow

Community Member, 73 Posts

25 July 2007 at 12:19pm

Edited: 25/07/2007 12:19pm

woohoo was hoping for this... how do we go about getting it?


Community Member, 201 Posts

25 July 2007 at 1:32pm

You'll need to update your version of SilverStripe to 2.0.2