File for Full URL (Domain Path)

Silverstripe Version: 5.3

Question:

Hi everyone,
Can someone help me find the file where I can specify the full domain path (https)?

The problem is that CSS styles are not loading when accessing the site via the domain name (https), but everything works fine when using the IP address.

I need to find the file where I can set this up on an already installed Silverstripe site.

You can try setting it in the SS_BASE_URL environment variable. https://docs.silverstripe.org/en/5/getting_started/environment_management/#core-environment-variables

You may need to provide a bit more info about the way your site is configured / hosted if the above doesn’t work.


it works, but the styles don’t load. :face_with_raised_eyebrow:
here is the .env file

S_DATABASE_CLASS="MySQLDatabase"
SS_DATABASE_SERVER="localhost"
SS_DATABASE_USERNAME="silveruser"
SS_DATABASE_PASSWORD="silverpass"
SS_DATABASE_NAME="silverstripe"
SS_ENVIRONMENT_TYPE="dev"
SS_ENVIRONMENT_TYPE="dev"
SS_BASE_URL="https://domen.ru"

for some reason, only the logo of the admin panel works from CSS
but when logged in, the CSS is not loaded.

OK, if you look at the requests in your developer tools… are they going to the correct URI? What responses are you getting? (403, 404, 50x, etc.)

I don’t really understand that’s what:

Admin panel, only part of it works

As Tim has mentioned, some information about the way your hosting setup will be useful here. I assume the piece of information you’ve redacted in the screenshots is the server name.

If that’s the case, perhaps you have a reverse proxy set up, and the host header being passed through from the proxy doesn’t match the host you’re actually using in your browser.

I recommend using a debugger like xdebug and stepping through the Director::host() method and see how it’s coming to the conclusion it’s coming to, as that may clue you into what’s going wrong and hopefully how to resolve it.

replaced

/themes/simple/templates/Page.ss

<%base_tag %>
on
<base href="https://domen.ru /" />

styles are working :thinking:
something is not clear with app/src/PageController.php does not update links in templates

the files mode does not work

Preview mode is not working

how to fix it?
f12

You cannot mix http with https, and all the messages above say that.

In your template/configuration/cache you have something with http.

Be careful: the above code has a space after .ru and before the slash.

Apart from that, what you did means Director::baseURL() returned a wrong URL (most likely with http instead of https). You must fix the root cause, do not hide the problem by manually setting the proper base tag.

For some reason, the SS_BASE_URL in your .env seems to not be picked up. Are you sure that environment file is the one deployed? Is there some cache that needs to be refreshed? E.g. if you are using php-fpm, try to restart the service.

Not sure this is relevant, but that public URL returns SSL_ERROR_BAD_CERT_DOMAIN (the certificate is valid for different names).

Also, check you do not specify alternate_base_url somewhere in your PHP code.

where to find and fix the JavaScript that generates requests for admin.types.graphql ? Make a crutch