| | |
| | | $crt_file = $ssl_dir.'/'.$domain.'.crt'; |
| | | |
| | | //* Create a SSL Certificate |
| | | if($data['new']['ssl_action'] == 'create') { |
| | | if($data['new']['ssl_action'] == 'create' && $conf['mirror_server_id'] == 0) { |
| | | |
| | | $this->ssl_certificate_changed = true; |
| | | |
| | |
| | | switch($data['new']['subdomain']) { |
| | | case 'www': |
| | | if(substr($data['new']['redirect_path'],0,1) == '/'){ // relative path |
| | | $rewrite_exclude = '(?!'.substr($data['new']['redirect_path'],0,-1).')'; |
| | | $rewrite_exclude = '((?!'.substr($data['new']['redirect_path'],0,-1).'))'; |
| | | } else { // URL - check if URL is local |
| | | $tmp_redirect_path = $data['new']['redirect_path']; |
| | | if(substr($tmp_redirect_path,0,7) == '$scheme') $tmp_redirect_path = 'http'.substr($tmp_redirect_path,7); |
| | |
| | | if($tmp_redirect_path_parts['host'] == $data['new']['domain'] && ($tmp_redirect_path_parts['port'] == '80' || $tmp_redirect_path_parts['port'] == '443' || !isset($tmp_redirect_path_parts['port']))){ |
| | | if(substr($tmp_redirect_path_parts['path'],-1) == '/') $tmp_redirect_path_parts['path'] = substr($tmp_redirect_path_parts['path'],0,-1); |
| | | if(substr($tmp_redirect_path_parts['path'],0,1) != '/') $tmp_redirect_path_parts['path'] = '/'.$tmp_redirect_path_parts['path']; |
| | | $rewrite_exclude = '(?!'.$tmp_redirect_path_parts['path'].')'; |
| | | $rewrite_exclude = '((?!'.$tmp_redirect_path_parts['path'].'))'; |
| | | } else { |
| | | $rewrite_exclude = '(.?)'; |
| | | } |
| | |
| | | 'rewrite_exclude' => $rewrite_exclude); |
| | | |
| | | if(substr($data['new']['redirect_path'],0,1) == '/'){ // relative path |
| | | $rewrite_exclude = '(?!'.substr($data['new']['redirect_path'],0,-1).')'; |
| | | $rewrite_exclude = '((?!'.substr($data['new']['redirect_path'],0,-1).'))'; |
| | | } else { // URL - check if URL is local |
| | | $tmp_redirect_path = $data['new']['redirect_path']; |
| | | if(substr($tmp_redirect_path,0,7) == '$scheme') $tmp_redirect_path = 'http'.substr($tmp_redirect_path,7); |
| | |
| | | if($tmp_redirect_path_parts['host'] == 'www.'.$data['new']['domain'] && ($tmp_redirect_path_parts['port'] == '80' || $tmp_redirect_path_parts['port'] == '443' || !isset($tmp_redirect_path_parts['port']))){ |
| | | if(substr($tmp_redirect_path_parts['path'],-1) == '/') $tmp_redirect_path_parts['path'] = substr($tmp_redirect_path_parts['path'],0,-1); |
| | | if(substr($tmp_redirect_path_parts['path'],0,1) != '/') $tmp_redirect_path_parts['path'] = '/'.$tmp_redirect_path_parts['path']; |
| | | $rewrite_exclude = '(?!'.$tmp_redirect_path_parts['path'].')'; |
| | | $rewrite_exclude = '((?!'.$tmp_redirect_path_parts['path'].'))'; |
| | | } else { |
| | | $rewrite_exclude = '(.?)'; |
| | | } |
| | |
| | | break; |
| | | case '*': |
| | | if(substr($data['new']['redirect_path'],0,1) == '/'){ // relative path |
| | | $rewrite_exclude = '(?!'.substr($data['new']['redirect_path'],0,-1).')'; |
| | | $rewrite_exclude = '((?!'.substr($data['new']['redirect_path'],0,-1).'))'; |
| | | } else { // URL - check if URL is local |
| | | $tmp_redirect_path = $data['new']['redirect_path']; |
| | | if(substr($tmp_redirect_path,0,7) == '$scheme') $tmp_redirect_path = 'http'.substr($tmp_redirect_path,7); |
| | |
| | | if(substr($tmp_redirect_path_parts['host'],-strlen($data['new']['domain'])) == $data['new']['domain'] && ($tmp_redirect_path_parts['port'] == '80' || $tmp_redirect_path_parts['port'] == '443' || !isset($tmp_redirect_path_parts['port']))){ |
| | | if(substr($tmp_redirect_path_parts['path'],-1) == '/') $tmp_redirect_path_parts['path'] = substr($tmp_redirect_path_parts['path'],0,-1); |
| | | if(substr($tmp_redirect_path_parts['path'],0,1) != '/') $tmp_redirect_path_parts['path'] = '/'.$tmp_redirect_path_parts['path']; |
| | | $rewrite_exclude = '(?!'.$tmp_redirect_path_parts['path'].')'; |
| | | $rewrite_exclude = '((?!'.$tmp_redirect_path_parts['path'].'))'; |
| | | } else { |
| | | $rewrite_exclude = '(.?)'; |
| | | } |
| | |
| | | break; |
| | | default: |
| | | if(substr($data['new']['redirect_path'],0,1) == '/'){ // relative path |
| | | $rewrite_exclude = '(?!'.substr($data['new']['redirect_path'],0,-1).')'; |
| | | $rewrite_exclude = '((?!'.substr($data['new']['redirect_path'],0,-1).'))'; |
| | | } else { // URL - check if URL is local |
| | | $tmp_redirect_path = $data['new']['redirect_path']; |
| | | if(substr($tmp_redirect_path,0,7) == '$scheme') $tmp_redirect_path = 'http'.substr($tmp_redirect_path,7); |
| | |
| | | if($tmp_redirect_path_parts['host'] == $data['new']['domain'] && ($tmp_redirect_path_parts['port'] == '80' || $tmp_redirect_path_parts['port'] == '443' || !isset($tmp_redirect_path_parts['port']))){ |
| | | if(substr($tmp_redirect_path_parts['path'],-1) == '/') $tmp_redirect_path_parts['path'] = substr($tmp_redirect_path_parts['path'],0,-1); |
| | | if(substr($tmp_redirect_path_parts['path'],0,1) != '/') $tmp_redirect_path_parts['path'] = '/'.$tmp_redirect_path_parts['path']; |
| | | $rewrite_exclude = '(?!'.$tmp_redirect_path_parts['path'].')'; |
| | | $rewrite_exclude = '((?!'.$tmp_redirect_path_parts['path'].'))'; |
| | | } else { |
| | | $rewrite_exclude = '(.?)'; |
| | | } |
| | |
| | | switch($alias['subdomain']) { |
| | | case 'www': |
| | | if(substr($alias['redirect_path'],0,1) == '/'){ // relative path |
| | | $rewrite_exclude = '(?!'.substr($alias['redirect_path'],0,-1).')'; |
| | | $rewrite_exclude = '((?!'.substr($alias['redirect_path'],0,-1).'))'; |
| | | } else { // URL - check if URL is local |
| | | $tmp_redirect_path = $alias['redirect_path']; |
| | | if(substr($tmp_redirect_path,0,7) == '$scheme') $tmp_redirect_path = 'http'.substr($tmp_redirect_path,7); |
| | |
| | | if($tmp_redirect_path_parts['host'] == $alias['domain'] && ($tmp_redirect_path_parts['port'] == '80' || $tmp_redirect_path_parts['port'] == '443' || !isset($tmp_redirect_path_parts['port']))){ |
| | | if(substr($tmp_redirect_path_parts['path'],-1) == '/') $tmp_redirect_path_parts['path'] = substr($tmp_redirect_path_parts['path'],0,-1); |
| | | if(substr($tmp_redirect_path_parts['path'],0,1) != '/') $tmp_redirect_path_parts['path'] = '/'.$tmp_redirect_path_parts['path']; |
| | | $rewrite_exclude = '(?!'.$tmp_redirect_path_parts['path'].')'; |
| | | $rewrite_exclude = '((?!'.$tmp_redirect_path_parts['path'].'))'; |
| | | } else { |
| | | $rewrite_exclude = '(.?)'; |
| | | } |
| | |
| | | 'rewrite_exclude' => $rewrite_exclude); |
| | | |
| | | if(substr($alias['redirect_path'],0,1) == '/'){ // relative path |
| | | $rewrite_exclude = '(?!'.substr($alias['redirect_path'],0,-1).')'; |
| | | $rewrite_exclude = '((?!'.substr($alias['redirect_path'],0,-1).'))'; |
| | | } else { // URL - check if URL is local |
| | | $tmp_redirect_path = $alias['redirect_path']; |
| | | if(substr($tmp_redirect_path,0,7) == '$scheme') $tmp_redirect_path = 'http'.substr($tmp_redirect_path,7); |
| | |
| | | if($tmp_redirect_path_parts['host'] == 'www.'.$alias['domain'] && ($tmp_redirect_path_parts['port'] == '80' || $tmp_redirect_path_parts['port'] == '443' || !isset($tmp_redirect_path_parts['port']))){ |
| | | if(substr($tmp_redirect_path_parts['path'],-1) == '/') $tmp_redirect_path_parts['path'] = substr($tmp_redirect_path_parts['path'],0,-1); |
| | | if(substr($tmp_redirect_path_parts['path'],0,1) != '/') $tmp_redirect_path_parts['path'] = '/'.$tmp_redirect_path_parts['path']; |
| | | $rewrite_exclude = '(?!'.$tmp_redirect_path_parts['path'].')'; |
| | | $rewrite_exclude = '((?!'.$tmp_redirect_path_parts['path'].'))'; |
| | | } else { |
| | | $rewrite_exclude = '(.?)'; |
| | | } |
| | |
| | | break; |
| | | case '*': |
| | | if(substr($alias['redirect_path'],0,1) == '/'){ // relative path |
| | | $rewrite_exclude = '(?!'.substr($alias['redirect_path'],0,-1).')'; |
| | | $rewrite_exclude = '((?!'.substr($alias['redirect_path'],0,-1).'))'; |
| | | } else { // URL - check if URL is local |
| | | $tmp_redirect_path = $alias['redirect_path']; |
| | | if(substr($tmp_redirect_path,0,7) == '$scheme') $tmp_redirect_path = 'http'.substr($tmp_redirect_path,7); |
| | |
| | | if(substr($tmp_redirect_path_parts['host'],-strlen($alias['domain'])) == $alias['domain'] && ($tmp_redirect_path_parts['port'] == '80' || $tmp_redirect_path_parts['port'] == '443' || !isset($tmp_redirect_path_parts['port']))){ |
| | | if(substr($tmp_redirect_path_parts['path'],-1) == '/') $tmp_redirect_path_parts['path'] = substr($tmp_redirect_path_parts['path'],0,-1); |
| | | if(substr($tmp_redirect_path_parts['path'],0,1) != '/') $tmp_redirect_path_parts['path'] = '/'.$tmp_redirect_path_parts['path']; |
| | | $rewrite_exclude = '(?!'.$tmp_redirect_path_parts['path'].')'; |
| | | $rewrite_exclude = '((?!'.$tmp_redirect_path_parts['path'].'))'; |
| | | } else { |
| | | $rewrite_exclude = '(.?)'; |
| | | } |
| | |
| | | break; |
| | | default: |
| | | if(substr($alias['redirect_path'],0,1) == '/'){ // relative path |
| | | $rewrite_exclude = '(?!'.substr($alias['redirect_path'],0,-1).')'; |
| | | $rewrite_exclude = '((?!'.substr($alias['redirect_path'],0,-1).'))'; |
| | | } else { // URL - check if URL is local |
| | | $tmp_redirect_path = $alias['redirect_path']; |
| | | if(substr($tmp_redirect_path,0,7) == '$scheme') $tmp_redirect_path = 'http'.substr($tmp_redirect_path,7); |
| | |
| | | if($tmp_redirect_path_parts['host'] == $alias['domain'] && ($tmp_redirect_path_parts['port'] == '80' || $tmp_redirect_path_parts['port'] == '443' || !isset($tmp_redirect_path_parts['port']))){ |
| | | if(substr($tmp_redirect_path_parts['path'],-1) == '/') $tmp_redirect_path_parts['path'] = substr($tmp_redirect_path_parts['path'],0,-1); |
| | | if(substr($tmp_redirect_path_parts['path'],0,1) != '/') $tmp_redirect_path_parts['path'] = '/'.$tmp_redirect_path_parts['path']; |
| | | $rewrite_exclude = '(?!'.$tmp_redirect_path_parts['path'].')'; |
| | | $rewrite_exclude = '((?!'.$tmp_redirect_path_parts['path'].'))'; |
| | | } else { |
| | | $rewrite_exclude = '(.?)'; |
| | | } |