tj Posted September 6, 2006 Share Posted September 6, 2006 I get first post in this forum! Ok well I hope some of you will find this useful! Its a line of php that will redirect the users browser to the SSL'd version of your WHM system. If a user types the url of your system directly as: http://billing.webhost.com,'>http://billing.webhost.com, nothing exchanged between the system and the user is encrypted leaving the information exposed. With the code below {php} /* redirect to secure site ALWAYS?? */ if ($_SERVER["SERVER_PORT"] != 443) { header('Location: https://billing.webhost.com/index.php'); } {/php} If a user where to type http://billing.webhost.com he/she will be redirected to https://billing.webhost.com. Just paste that in at the top of your header.tpl file. And dont forget to change the https://billing.webhost.com/index.php to your url! Just my two cents Link to comment Share on other sites More sharing options...
xxkylexx Posted September 7, 2006 Share Posted September 7, 2006 The following method might work a bit better, since it will force https:// for any URL that is entered in http:// form, not just redirect to the index page. This will only work if the billing software is on it's own domain or subdomain, however. Put the following in .htaccess or in your httpd.conf: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} You can see this working with some of the following links on my site, which are in http:// form below: http://members.websolvents.com/ http://members.websolvents.com/knowledgebase.php?action=displayarticle&catid=3&id=14 http://members.websolvents.com/domainchecker.php Enjoy! Kyle Link to comment Share on other sites More sharing options...
MACscr Posted September 7, 2006 Share Posted September 7, 2006 Or you can try this, which gives you the benefits of both worlds. http://www.whmcs.com/forums/viewtopic.php?t=1067&highlight= Link to comment Share on other sites More sharing options...
Adam Posted September 22, 2006 Share Posted September 22, 2006 Hey, I like Kyle's method better as this would be for the whole folder, sub-domain or domain - where ever the .htaccess file is located... From, Adam Link to comment Share on other sites More sharing options...
MACscr Posted September 22, 2006 Share Posted September 22, 2006 true, it would work that way, but using it for the knowledgebase, tutorials, homepage, etc, is just a waste of resources IMHO. https uses more resources and of course then,is slower. But hey, to each his own. Link to comment Share on other sites More sharing options...
imaginit Posted December 19, 2006 Share Posted December 19, 2006 Works like a charm MACscr! Thanks for sharing! You also just opened my complex eyes to how simple it really is to add to this system! Thanks for that as well! Link to comment Share on other sites More sharing options...
Recommended Posts