22850 Posts in 9711 Topics by 2803 members
|Go to End|
21 June 2012 at 1:35pm Last edited: 21 June 2012 1:35pm
Does anyone know how to prevent silverstripe (2.4) outputting the protocol and host when linking to internal assets etc?
In the markup I am getting:
and I want just:
The reason is that requests are going through a proxy so requests to https://localhost:8000/ are being proxied to http://my.exampledomain.com/ so I don't want http://my.exampledomain.com/ in the markup.
I've had a look around in Director and tried a few things including:
21 June 2012 at 10:21pm
Taking a look at the code it looks like this is hard coded to being absolute. In the Requirements_Backend::path_for_file() class you would need to replace the prefixed value. Patches welcome to make this more accessible.
22 June 2012 at 9:54am
Thanks for looking at it. I ended up modifying the path_for_file function in core/Requirements.php as follows:
// $prefix = Director::absoluteBaseURL();
$prefix = Director::baseURL();
|Go to Top|