Set base url in configuration

江枫思渺然 提交于 2019-12-11 08:29:01

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!