Skip to content
Snippets Groups Projects
Commit df73824d authored by tbrehm's avatar tbrehm
Browse files

Fixed a bug in apache rewrite rules.

parent a3576476
No related branches found
No related tags found
No related merge requests found
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
<VirtualHost <tmpl_var name='ip_address'>:80> <VirtualHost <tmpl_var name='ip_address'>:80>
DocumentRoot <tmpl_var name='web_document_root'> DocumentRoot <tmpl_var name='web_document_root'>
ServerName <tmpl_var name='domain'> ServerName <tmpl_var name='domain'>
<tmpl_if name='alias'>
ServerAlias <tmpl_var name='alias'> ServerAlias <tmpl_var name='alias'>
RewriteEngine on </tmpl_if>
<tmpl_if name='cgi'> <tmpl_if name='cgi'>
# cgi enabled # cgi enabled
ScriptAlias /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/ ScriptAlias /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
...@@ -18,7 +19,7 @@ ...@@ -18,7 +19,7 @@
AddOutputFilter INCLUDES .shtml AddOutputFilter INCLUDES .shtml
</tmpl_if> </tmpl_if>
<tmpl_if name='suexec'> <tmpl_if name='suexec'>
# suexec enabled # suexec enabled
SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'> SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
</tmpl_if> </tmpl_if>
<tmpl_if name='php' op='==' value='mod'> <tmpl_if name='php' op='==' value='mod'>
...@@ -37,10 +38,12 @@ ...@@ -37,10 +38,12 @@
AddType application/x-httpd-php .php .php3 .php4 .php5 AddType application/x-httpd-php .php .php3 .php4 .php5
</tmpl_if> </tmpl_if>
<tmpl_if name="rewrite_enabled">
RewriteEngine on
<tmpl_loop name="redirects"> <tmpl_loop name="redirects">
RewriteCond %{HTTP_HOST} ^<tmpl_var name='rewrite_domain'> [NC] RewriteCond %{HTTP_HOST} ^<tmpl_var name='rewrite_domain'> [NC]
RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'>$1 [<tmpl_var name='rewrite_type'>] RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'>$1 [<tmpl_var name='rewrite_type'>]
</tmpl_loop> </tmpl_loop>
</tmpl_if>
</VirtualHost> </VirtualHost>
\ No newline at end of file
...@@ -165,6 +165,11 @@ class apache2_plugin { ...@@ -165,6 +165,11 @@ class apache2_plugin {
} }
} }
$tpl->setVar('alias',trim($server_alias)); $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); $tpl->setLoop('redirects',$rewrite_rules);
$vhost_file = escapeshellcmd($web_config["vhost_conf_dir"].'/'.$data["new"]["domain"].'.vhost'); $vhost_file = escapeshellcmd($web_config["vhost_conf_dir"].'/'.$data["new"]["domain"].'.vhost');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment