Maximum
Maximum

Reputation: 61

Silverstripe 4 change base url

where is it possible to change the baseURL on Silverstripe v4? Also after rewrite the base tag with http is set at the website. I would like to specify the baseURL itself, which will be applied to all pages (front site, admin).

Thanks for every tip

Upvotes: 2

Views: 1972

Answers (2)

BaronGrivet
BaronGrivet

Reputation: 4424

It's good practice to set the base URL in the .env environment file so you can set separate base URLs for local development/ staging/ production etc.

We use the following line in the /.env file:

SS_BASE_URL="https://example.com/"

And then add the following to /app/_config/mysite.yml:

SilverStripe\Control\Director:
  alternate_base_url: '`SS_BASE_URL`'

Upvotes: 4

Fatal Error
Fatal Error

Reputation: 1024

You can set an alternating base URL like so:

_config/config.yml

SilverStripe\Control\Director:
  alternate_base_url: 'your/base/url/'

Upvotes: 3

Related Questions