annomander Posted September 4, 2009 Share Posted September 4, 2009 (edited) I have just installed a SSL, and I have a slight problem with my custom template pages. If I go to a page that whmcs directs to https, eg: Login and then go to one of my custom template pages, the page stays for that one visit at https, but because the base url is set to http, I get image errors invalidating the ssl. If I click somewhere else, then it gos back to http. But I've noticed on index, downloads, etc that this two click rule isn't present, how can I get my custom pages to act the same as certain whmcs pages? cheers Edited September 4, 2009 by annomander 0 Quote Link to comment Share on other sites More sharing options...
ckh Posted September 4, 2009 Share Posted September 4, 2009 Don't hard code your domain name in the links, use relative links. <img src="/images/myimage.gif"> instead of: <img src="http://yourdomain.com/images/myimage.gif"> Same thing with any links, use: <a href="/mypage.php">Click Here</a> instead of: <a href="http://mydomain.com/mypage.php">Click Here</a> 0 Quote Link to comment Share on other sites More sharing options...
annomander Posted September 5, 2009 Author Share Posted September 5, 2009 Hi I have this already, but this makes no difference due to the baseurl in the header 0 Quote Link to comment Share on other sites More sharing options...
mylove4life Posted September 5, 2009 Share Posted September 5, 2009 If you post a link we can take a look. 0 Quote Link to comment Share on other sites More sharing options...
annomander Posted September 5, 2009 Author Share Posted September 5, 2009 Sorry http://www.studyhost.co.uk/ If you click on registar and then click back onto one of the template pages, it keeps the https for one visit, unless its home, downloads, knowledgebase cheers 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted September 5, 2009 Share Posted September 5, 2009 All of the pages that you click back seem to be custom pages. WHMCS only handles to standard whmcs pages so it thinks it is still https. to fix open header.tpl and change this {if $systemurl}<base href="{$systemurl}" />{/if} to this {php}global $CONFIG;$this->assign('url', (($_SERVER['HTTPS'] == 'on') ? $CONFIG['SystemSSLURL'] : $CONFIG['SystemURL']));{/php} <base href="{$url}/" /> 0 Quote Link to comment Share on other sites More sharing options...
annomander Posted September 5, 2009 Author Share Posted September 5, 2009 Cheers that solves the ssl errors, to make the other pages go to http, I presume I would need to add a lot htaccess redirects 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted September 5, 2009 Share Posted September 5, 2009 to make the other pages go to http, I presume I would need to add a lot htaccess redirects No, If you do that you will end up with an endless loop as whmcs will keep changing it back to https. Certain pages in whmcs should be https like the cart, login, and the clientarea pages. 0 Quote Link to comment Share on other sites More sharing options...
annomander Posted September 5, 2009 Author Share Posted September 5, 2009 What happens at the moment, if we take for example 3 pages and a senario. home (index) hosting plans (custom template) login (secure ssl) If we are on home (http) and then go to hosting this stays as http, if we go to login then it changes to https as it should. Now that we are on login, if we go back to plans then it stays as https for that visit. but if we go to the home page straight off, then it switches to http straight away. Now a curious action is if we have two custom pages and are at login with https in the url, if we click on custom1, it stays https, but if we then click on custom2 it switches to http on the second click? Its not a big deal now that its not displaying errors. Cheers 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted September 5, 2009 Share Posted September 5, 2009 That is normal, whmcs forces some pages to https and others to http. A small script could be written to force custom pages back to http or even force them to https 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.