Dominik
2015-12-29 a639ee6c703cbaa9a89e195c343c473ee57294c6
append *-Autosubdomains as last rules to rewrite rules
After this, it is possible to use both:
- sub.domain.tld
- *.domain.tld
together with different folders by rewrite (with rewrite_type = L for sub.domain.tld)
Before it was not clearified which rule matches first, it always dependet on the creation-time of the subdomain

Conflicts:
server/plugins-available/apache2_plugin.inc.php
1 files modified
7 ■■■■ changed files
server/plugins-available/apache2_plugin.inc.php 7 ●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php
@@ -1233,6 +1233,7 @@
        // Rewrite rules
        $rewrite_rules = array();
        $rewrite_wildcard_rules = array();
        if($data['new']['redirect_type'] != '' && $data['new']['redirect_path'] != '') {
            if(substr($data['new']['redirect_path'], -1) != '/' && !preg_match('/^(https?|\[scheme\]):\/\//', $data['new']['redirect_path'])) $data['new']['redirect_path'] .= '/';
            if(substr($data['new']['redirect_path'], 0, 8) == '[scheme]'){
@@ -1264,7 +1265,7 @@
                    'rewrite_add_path' => (substr($rewrite_target, -1) == '/' ? 'y' : 'n'));
                break;
            case '*':
                $rewrite_rules[] = array( 'rewrite_domain'  => '(^|\.)'.$this->_rewrite_quote($data['new']['domain']),
                $rewrite_wildcard_rules[] = array( 'rewrite_domain'  => '(^|\.)'.$this->_rewrite_quote($data['new']['domain']),
                    'rewrite_type'   => ($data['new']['redirect_type'] == 'no')?'':'['.$data['new']['redirect_type'].']',
                    'rewrite_target'  => $rewrite_target,
                    'rewrite_target_ssl' => $rewrite_target_ssl,
@@ -1363,7 +1364,7 @@
                            'rewrite_add_path' => (substr($rewrite_target, -1) == '/' ? 'y' : 'n'));
                        break;
                    case '*':
                        $rewrite_rules[] = array( 'rewrite_domain'  => '(^|\.)'.$this->_rewrite_quote($alias['domain']),
                        $rewrite_wildcard_rules[] = array( 'rewrite_domain'  => '(^|\.)'.$this->_rewrite_quote($alias['domain']),
                            'rewrite_type'   => ($alias['redirect_type'] == 'no')?'':'['.$alias['redirect_type'].']',
                            'rewrite_target'  => $rewrite_target,
                            'rewrite_target_ssl' => $rewrite_target_ssl,
@@ -1400,6 +1401,8 @@
        } else {
            $tpl->setVar('alias', '');
        }
        if (count($rewrite_wildcard_rules) > 0) $rewrite_rules = array_merge($rewrite_rules, $rewrite_wildcard_rules); // Append wildcard rules to the end of rules
        if(count($rewrite_rules) > 0 || $vhost_data['seo_redirect_enabled'] > 0 || count($alias_seo_redirects) > 0) {
            $tpl->setVar('rewrite_enabled', 1);