File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 33<VirtualHost <tmpl_var name='ip_address'>:80>
44 DocumentRoot <tmpl_var name='web_document_root'>
55 ServerName <tmpl_var name='domain'>
6+
7+ <tmpl_if name='alias'>
68 ServerAlias <tmpl_var name='alias'>
7- RewriteEngine on
8-
9+ </tmpl_if>
910<tmpl_if name='cgi'>
1011 # cgi enabled
1112 ScriptAlias /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
1819 AddOutputFilter INCLUDES .shtml
1920</tmpl_if>
2021<tmpl_if name='suexec'>
21- # suexec enabled
22+ # suexec enabled
2223 SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
2324</tmpl_if>
2425<tmpl_if name='php' op='==' value='mod'>
3738 AddType application/x-httpd-php .php .php3 .php4 .php5
3839</tmpl_if>
3940
40-
41+ <tmpl_if name="rewrite_enabled">
42+ RewriteEngine on
4143<tmpl_loop name="redirects">
4244 RewriteCond %{HTTP_HOST} ^<tmpl_var name='rewrite_domain'> [NC]
4345 RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'>$1 [<tmpl_var name='rewrite_type'>]
4446</tmpl_loop>
47+ </tmpl_if>
4548
4649</VirtualHost>
Original file line number Diff line number Diff line change @@ -165,6 +165,11 @@ function update($event_name,$data) {
165165 }
166166 }
167167 $ tpl ->setVar ('alias ' ,trim ($ server_alias ));
168+ if (count ($ rewrite_rules ) > 0 ) {
169+ $ tpl ->setVar ('rewrite_enabled ' ,1 );
170+ } else {
171+ $ tpl ->setVar ('rewrite_enabled ' ,0 );
172+ }
168173 $ tpl ->setLoop ('redirects ' ,$ rewrite_rules );
169174
170175 $ vhost_file = escapeshellcmd ($ web_config ["vhost_conf_dir " ].'/ ' .$ data ["new " ]["domain " ].'.vhost ' );
You can’t perform that action at this time.
0 commit comments