copy paste this code into your lib/plugins/ondeniedlogin/action.php.
<?php if(!defined('DOKU_INC')) die(); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'action.php'); class action_plugin_forcessllogin extends DokuWiki_Action_Plugin { function getInfo( ) { return array( 'author' => 'Samuel Fischer', 'email' => 'sf@notomorrow.de', 'date' => '2012-01-23', 'name' => 'forcessllogin', 'desc' => 'redirects login requests to ssl', 'url' => 'http://www.dokuwiki.org/plugin:forcessllogin', ); } function register(&$controller) { $controller->register_hook('ACTION_ACT_PREPROCESS', 'AFTER', $this, 'forcessllogin'); $controller->register_hook('TPL_ACT_RENDER', 'AFTER', $this, 'forcessllogin'); //catch action change } function forcessllogin(&$event, $param) { global $ACT, $INFO, $ID; if($ACT != 'login') return; if( !is_ssl( )) { send_redirect( 'https://'.$this->host( ).wl( $ID ).'?do=login' ); exit; } } function host( ) { if(isset($_SERVER['HTTP_HOST'])){ $parsed_host = parse_url('http://'.$_SERVER['HTTP_HOST']); $host = $parsed_host['host']; }elseif(isset($_SERVER['SERVER_NAME'])){ $parsed_host = parse_url('http://'.$_SERVER['SERVER_NAME']); $host = $parsed_host['host']; }else{ $host = php_uname('n'); } return $host; } }