问题
How is it possible to set the base url?
In the documentation of 3.1 is written: Director::setBaseURL: Use Director.alternate_base_url instead
Is there any example where to put the Director.alternate_base_url?
Thank you
回答1:
The recommended way to do this is by updating your _config.yml
, adding the following lines (remember indentations are 2 spaces):
Director:
alternate_base_url: '/'
a full _config.yml
file could look something like
---
Name: mysite
After: 'framework/*','cms/*'
---
SSViewer:
theme: 'customTheme'
Director:
environment_type: 'live'
alternate_base_url: '/'
回答2:
Put the following string in your project _config.php file
Config::inst()->update( 'Director', 'alternate_base_url', '/' );
来源:https://stackoverflow.com/questions/20109864/set-base-url-in-configuration