Commit df73824d authored by tbrehm's avatar tbrehm
Browse files

Fixed a bug in apache rewrite rules.

parent a3576476
......@@ -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>
\ No newline at end of file
......@@ -165,6 +165,11 @@ class apache2_plugin {
}
}
$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');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment