21491 Posts in 5783 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2935 Views |
-
silent redirect to silverstripe/ folder

15 May 2009 at 3:39am
halloo..
I developed a site in mydomain.com/SilverStripe, 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 'mydomain.com' to be silently directed to mydomain.com/SilverStripe/index.php..At the moment I have a simple meta redirect on the mydomain.com/index.html 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 !
-
Re: silent redirect to silverstripe/ folder

15 May 2009 at 9:42pm
Could you not just remove the index.php that was the whole site?
-
Re: silent redirect to silverstripe/ folder

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,
Pascal
-
Re: silent redirect to silverstripe/ folder

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]
</IfModule>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
| 2935 Views | ||
|
Page:
1
|
Go to Top |



