I created patch that disables primary redirection for site from
"http://www.somesite.com/" to "http://www.somesite.com/home/"
and if someone tries to get http://www.somesite.com/home or http://www.somesite.com/home/ will be redirected to http://www.somesite.com/
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:
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.