1

I have this code:

<?php
header('Content-Type: text/css; charset=utf-8');
?>
a.logo{background:url(//webzina.net/img/logo.png) no-repeat 100% 0}

Locally (PHP Version 5.3.5), I get:

a.logo{background:url(//webzina.net/img/logo.png) no-repeat 100% 0}

But remotely (PHP Version 5.3.21), I get:

a.logo{background:url(http://webzina.net/img/logo.png) no-repeat 100% 0}

If I comment the header line, remotely I get the same as locally.

The worst is, remotely I am using https, so the "http:" is causing troubles.

Can someone tell me which apache/php setting is messing with the protocol-relative URL or why this is happening?

030
  • 5,901
  • 13
  • 68
  • 110
dxvargas
  • 145
  • 1
  • 1
  • 5

1 Answers1

2

Use Apache's mod_info (http://httpd.apache.org/docs/2.2/mod/mod_info.html) to view the output of the Apache configuration. Then search through it for text/css and see if there's any directive which specifies something should act on CSS files. For example, you might find an AddOutputFilterByType directive. Depending on your setup, there's also a possibility on the remote side that there's a proxy that's modifying the CSS file and if so, you'd need to check the configuration on that.

sa289
  • 1,318
  • 2
  • 18
  • 44
  • Yes there is a proxy, that is a good tip. I will check with sysadmins, if they can test the php output behind the proxy. I'll come back after I have this information. – dxvargas Jul 07 '15 at 18:25
  • 1
    Here is the response I got from sysadmin: "There is a transform on this mapping, because the path between the reverse proxy and the backend server are different. You can use absolute path instead of relative to avoid this rewriting.". So, yes, it is is proxy's fault. Thanks! – dxvargas Jul 09 '15 at 12:24