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.

General Questions

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

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

silent redirect to silverstripe/ folder


4 Posts   3282 Views


15 May 2009 at 3:39am Community Member, 13 Posts


I developed a site in, but have my own custom index.php file that 'is' the whole site..
Now the site is ready for public viewing, I need visitors to '' to be silently directed to

At the moment I have a simple meta redirect on the page, but of course, would like to do some mod-rewrite/htaccess stuff to make the silent redirection.

My htaccess file that lives in the /SilverStripe/ folder has a RewriteBase of /SilverStripe already..

Any clever apache type folks out there know the easy answer ? :)

Thank u !


15 May 2009 at 9:42pm Forum Moderator, 1091 Posts

Could you not just remove the index.php that was the whole site?


15 May 2009 at 11:16pm Community Member, 47 Posts

There is an attribute, called LegacyURL which you can redirect to a URL. You have to in the SilverStripe documentation.

Best regards,



16 May 2009 at 9:09pm Community Member, 901 Posts

You could place a .htaccess file with the following content in your web-root:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$

RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* SilverStripe/sapphire/main.php?url=%1&%{QUERY_STRING} [L]

This would route the requests to the SilverStripe/sapphire/main.php..
There might be other things that need to be fixed though. I can imagine the base url of the SilverStripe site won't be generated correctly and then you would have to rewrite asset paths as well