4642 Posts in 1401 Topics by 1394 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1167 Views |
-
multiple sites, internal rewrite, getting rid of subdir

14 February 2009 at 3:12am
I have installed two copies of silverstripe in a hosted account. My main .htaccess file has rewrite rules like:
RewriteCond %{HTTP_HOST} ^(www\.)?somesite\..* [OR]
RewriteCond %{HTTP_HOST} ^$
RewriteCond %{REQUEST_URI} !^/cms.somesite/
RewriteRule (.*) /cms.somesite/$1 [L]
#
RewriteCond %{HTTP_HOST} ^(www\.)?othersite\..*
RewriteCond %{REQUEST_URI} !^/cms.othersite/
RewriteRule (.*) /cms.othersite/$1 [L]This works fine, only all links point to the subdirs (e.g. http://somesite.net/cms.somesite/about-us/)
How can I teach silverstripe to generate links to http://somesite/about-us/ ?
I think it could be done in the main silverstripe .htaccess rewrite rules, but I'd rather not touch that. Is there
some way to force a base url?thanks, Mathias
-
Re: multiple sites, internal rewrite, getting rid of subdir

14 February 2009 at 3:12am
Oh well, to answer my own question:
Director::setBaseURL("http://somesite.com/);
does it.
-
Re: multiple sites, internal rewrite, getting rid of subdir

14 February 2009 at 3:23am Last edited: 14 February 2009 3:27am
Well, well, well...
not quite a working solution.Login no longer works, the login page just comes up again, no error msg at all.
I have to go to http://somesite.com/cms.somesite/Security/login for a working login,
and use http://somesite.com/cms.somesite/admin as cms url; and this doesn't work
since setBaseURL make all links to http://somesite.com/[admin_section], which
leads me to the login page again even if logged in.Any idea how to get login to work on http://somesite.com/Security/login ?
| 1167 Views | ||
|
Page:
1
|
Go to Top |

