tbrehm
2007-07-03 df73824dd5dccad9ecdd5315df2b4cf618e086a4
Fixed a bug in apache rewrite rules.
2 files modified
16 ■■■■ changed files
server/conf/vhost.conf.master 11 ●●●●● patch | view | raw | blame | history
server/plugins-enabled/apache2_plugin.inc.php 5 ●●●●● patch | view | raw | blame | history
server/conf/vhost.conf.master
@@ -3,9 +3,10 @@
<VirtualHost <tmpl_var name='ip_address'>:80>
    DocumentRoot <tmpl_var name='web_document_root'>
    ServerName <tmpl_var name='domain'>
<tmpl_if name='alias'>
    ServerAlias <tmpl_var name='alias'>
    RewriteEngine on
</tmpl_if>
<tmpl_if name='cgi'>
    # cgi enabled
    ScriptAlias  /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
@@ -18,7 +19,7 @@
    AddOutputFilter INCLUDES .shtml
</tmpl_if>
<tmpl_if name='suexec'>
    # suexec enabled
    # suexec enabled
    SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
</tmpl_if>
<tmpl_if name='php' op='==' value='mod'>
@@ -37,10 +38,12 @@
    AddType application/x-httpd-php .php .php3 .php4 .php5
</tmpl_if>
<tmpl_if name="rewrite_enabled">
    RewriteEngine on
<tmpl_loop name="redirects">
    RewriteCond %{HTTP_HOST}   ^<tmpl_var name='rewrite_domain'> [NC]
    RewriteRule   ^/(.*)$ <tmpl_var name='rewrite_target'>$1  [<tmpl_var name='rewrite_type'>]
</tmpl_loop>
</tmpl_if>
</VirtualHost>
server/plugins-enabled/apache2_plugin.inc.php
@@ -165,6 +165,11 @@
            }
        }
        $tpl->setVar('alias',trim($server_alias));
        if(count($rewrite_rules) > 0) {
            $tpl->setVar('rewrite_enabled',1);
        } else {
            $tpl->setVar('rewrite_enabled',0);
        }
        $tpl->setLoop('redirects',$rewrite_rules);
        
        $vhost_file = escapeshellcmd($web_config["vhost_conf_dir"].'/'.$data["new"]["domain"].'.vhost');