Page 1 of 2
CSS path changed to HTTPS
Posted: Sun Oct 19, 2014 3:02 pm
by sugna
http://netdes.com/
1.11.11 "San Cristobal"
PHP 5.3.29
MediaTemple.net Grid Service
Out of the blue yesterday my sites using CMSMS stopped processing relative URL's using {cms_stylesheet}
Do you think this is a hack issue?
These site have been working as expected for years.
For some reason my CSS's link is using HTTPS and the only way I can make things work is to use absolute URLS and point to a css file in the root of the server.
Code: Select all
https://netdes.com/tmp/cache/stylesheet_combined_636a793f7cb67b5359a87b907d3ef877.css
See source
http://netdes.com/
Do you think this is a hack issue?
Re: CSS path changed to HTTPS
Posted: Sun Oct 19, 2014 7:23 pm
by chandra
Check your config.php and the config reference in /docs folder

.
Re: CSS path changed to HTTPS
Posted: Sun Oct 19, 2014 7:38 pm
by sugna
These sites have been working for years. No changes other then upgrades. This just happened out of the blue.
Note this is also happening on another Media Temple grid server that is not connected to mine.
And just to be sure I purchased a new domain and added it to my current grid service as a subdomain. Installed a fresh copy of CMSMS and experience the same issue out of the box.
http://rocknrollsocialite.com
Another note: http://jmkservices.us/ is running 1.6.6 "Bonde" and has no issues. on the same grid server as this site:
http://rocknrollexperience.com/
Some how root domains are being rewritten to look like HTTPS and not HTTP this is causing the error.
Here's the config for this particular site.
<?php
# CMS Made Simple Configuration File
# Documentation: /doc/CMSMS_config_reference.pdf
#
$config['dbms'] = 'mysql';
$config['db_hostname'] = 'XXX';
$config['db_username'] = 'XXX';
$config['db_password'] = 'XXX';
$config['db_name'] = 'XXX';
$config['db_prefix'] = 'cms_';
$config['db_port'] = 0;
$config['root_url'] = 'http://netdes.com';
$config['timezone'] = 'America/Los_Angeles';
$config['default_encoding'] = 'utf-8';
$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '/';
$config['use_hierarchy'] = '';
$config['query_var'] = 'page';
?>
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 12:52 pm
by rotezecke
what happens when you change your {metadata} to {metadata showbase=false}?
it appears that for some reason this statement is always true
Code: Select all
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off')
{
$base = $config['ssl_url'];
}
(from metadata plugin)
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 1:10 pm
by sugna
I changed {metadata} to {metadata showbase=false}
Same issue.
Thanks rotezecke
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 1:16 pm
by sugna
In my config I added the line $config['ssl_url'] = '
http://netdes.com';
And the site is fixed and working as expected.
But does this cause a security issue?
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 1:17 pm
by rotezecke
http://netdes.com/
works here now, though.
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 1:19 pm
by sugna
Yes I added this line to the config
$config['ssl_url'] = '
http://netdes.com';
Is that secure?
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 1:23 pm
by rotezecke
do you have a login form, ecommerce or anything sensitive on that site? if not, you should be ok. although i'd consider this a hack, not a fix.
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 1:26 pm
by Jo Morg
I'm not sure why that happens and as I can't reproduce it I believe it's a server issue, however it seems that if you removed
$config['root_url'] = 'http://netdes.com'; and
$config['root_url'] = 'http://netdes.com'; you would have the whole site being redirected to https...
sugna wrote:Is that secure?
If the site was previously being served through http alone, that is fine as it seems you don't have a certificate installed for that domain. In order to have encrypted protocol you need that certificate.
rotezecke wrote:although i'd consider this a hack, not a fix.
A hack to what exactly? It doesn't seem that this is a CMSMS issue.
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 1:27 pm
by sugna
Nothing sensitive. Thanks for the tips that lead to the fix.
I've been waiting for tech support to answer my question to see if they changed anything in the grid environment to make this happen.
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 1:29 pm
by rotezecke
what is the output of {$smarty.server.HTTPS} ?
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 2:32 pm
by sugna
I'm not sure what to do with {$smarty.server.HTTPS}
I put that in the template and nothing displayed other then the page content.
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 3:46 pm
by rotezecke
Code: Select all
{if isset($smarty.server.HTTPS)} set {else} not {/if}
try this. if output is "set" (on a http request) tell your host.
Re: CSS path changed to HTTPS
Posted: Mon Oct 20, 2014 3:54 pm
by sugna
Sorry I'm not much of a coder other then normal frontend work.
Where would this go, in the php.ini, .htaccess, config? or else where
{if isset($smarty.server.HTTPS)} set {else} not {/if}