Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Templating] Asset URLs in SSL #4883

Closed
Closed
@acasademont

Description

@acasademont

Our site is 100% SSL, so ideally, we would like only to set one relative path for the assets and let symfony do de work:

framework:
  templating:
    assets_base_url: /path/to/my/assets

and then in Twig:

<img src="{{ asset('logo.png') }}"/>

Which should render:

<img src="/path/to/my/assets/logo.png"/>

But unfortunately, under SSL it renders:

<img src="logo.png"/>

The documentation clearly states:

If a URL starts with https:// or is protocol-relative (i.e. starts with //) it will be added to both collections. URL's starting with http:// will only be added to the http collection.

But that implies that relative paths (not starting with "https://" nor "//") won't be added to the ssl collection, which makes us do more work to configure the urls. Wouldn't it be better if ALL urls were copied to the SSL collection except the ones starting explicitely with the non-secure "http://"?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions