File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,13 @@ if [ "$aliases" = 'none' ]; then
114114else
115115 ALIAS=" www.$domain "
116116 if [ -z " $aliases " ]; then
117- ALIAS=" www.$domain "
117+ # Check and skip www alias for subdomains.
118+ IFS=' .' read -r -a domain_elements <<< " $domain"
119+ if [ " ${# domain_elements[@]} " -gt 2 ]; then
120+ ALIAS=" "
121+ else
122+ ALIAS=" www.$domain "
123+ fi
118124 else
119125 ALIAS=" $aliases "
120126 fi
Original file line number Diff line number Diff line change @@ -173,8 +173,12 @@ App.Listeners.WEB.keypress_domain_name();
173173
174174$ ( function ( ) {
175175 $ ( '#v_domain' ) . change ( function ( ) {
176- var prefix = 'www.' ;
177- document . getElementById ( 'v_aliases' ) . value = prefix + document . getElementById ( 'v_domain' ) . value ;
176+ if ( ( ( document . getElementById ( 'v_domain' ) . value ) . split ( "." ) ) . length === 2 ) {
177+ var prefix = 'www.' ;
178+ document . getElementById ( 'v_aliases' ) . value = prefix + document . getElementById ( 'v_domain' ) . value ;
179+ } else {
180+ document . getElementById ( 'v_aliases' ) . value = "" ;
181+ }
178182 } ) ;
179183 App . Actions . WEB . toggle_letsencrypt ( $ ( 'input[name=v_letsencrypt]' ) )
180184
You can’t perform that action at this time.
0 commit comments