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, Ed, biapar, Willr, Ingo, swaiba

silent redirect to silverstripe/ folder

Go to End

4 Posts   3819 Views


Community Member, 13 Posts

15 May 2009 at 3:39am


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 !


Forum Moderator, 1391 Posts

15 May 2009 at 9:42pm

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


Community Member, 47 Posts

15 May 2009 at 11:16pm

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

Best regards,



Community Member, 904 Posts

16 May 2009 at 9:09pm

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