CSS path changed to HTTPS

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
User avatar
sugna
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 10, 2007 3:04 pm
Location: USA

CSS path changed to HTTPS

Post 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?
chandra

Re: CSS path changed to HTTPS

Post by chandra »

Check your config.php and the config reference in /docs folder ;).
User avatar
sugna
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 10, 2007 3:04 pm
Location: USA

Re: CSS path changed to HTTPS

Post 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';
?>
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: CSS path changed to HTTPS

Post 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)
User avatar
sugna
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 10, 2007 3:04 pm
Location: USA

Re: CSS path changed to HTTPS

Post by sugna »

I changed {metadata} to {metadata showbase=false}

Same issue.

Thanks rotezecke
User avatar
sugna
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 10, 2007 3:04 pm
Location: USA

Re: CSS path changed to HTTPS

Post 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?
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: CSS path changed to HTTPS

Post by rotezecke »

http://netdes.com/
works here now, though.
User avatar
sugna
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 10, 2007 3:04 pm
Location: USA

Re: CSS path changed to HTTPS

Post by sugna »

Yes I added this line to the config

$config['ssl_url'] = 'http://netdes.com';

Is that secure?
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: CSS path changed to HTTPS

Post 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.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1967
Joined: Mon Jan 29, 2007 4:47 pm

Re: CSS path changed to HTTPS

Post 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.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
sugna
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 10, 2007 3:04 pm
Location: USA

Re: CSS path changed to HTTPS

Post 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.
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: CSS path changed to HTTPS

Post by rotezecke »

what is the output of {$smarty.server.HTTPS} ?
User avatar
sugna
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 10, 2007 3:04 pm
Location: USA

Re: CSS path changed to HTTPS

Post 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.
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: CSS path changed to HTTPS

Post 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.
User avatar
sugna
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 10, 2007 3:04 pm
Location: USA

Re: CSS path changed to HTTPS

Post 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}
Post Reply

Return to “The Lounge”