www support subdomains
NGINX-Conf: Remove www support for subdomains - only main domain will support both www and non-www.
This commit is contained in:
parent
cb11a00607
commit
84c86b3882
13
lib/sites
13
lib/sites
|
@ -319,18 +319,12 @@ deletesite() {
|
||||||
|
|
||||||
|
|
||||||
createsite() {
|
createsite() {
|
||||||
if [[ "$wp" == [123] && $(conf_read php) != "true" ]]; then
|
if [[ $(conf_read php) != "true" && ("$wp" == [123] || "$type" == "-php") ]]; then
|
||||||
echo "${red}"
|
echo "${red}"
|
||||||
echo " [ERROR] PHP must be installed before you can create a WP site!"
|
echo " [ERROR] PHP must be installed before you can create a WP site!"
|
||||||
echo "${end}"
|
echo "${end}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [[ "$type" == "-php" && $(conf_read php) != "true" ]]; then
|
|
||||||
echo "${red}"
|
|
||||||
echo " [ERROR] PHP must be installed before you can create a PHP site!"
|
|
||||||
echo "${end}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check for duplicate sites
|
# Check for duplicate sites
|
||||||
if [[ -a /etc/nginx/sites-available/$domain ]]; then
|
if [[ -a /etc/nginx/sites-available/$domain ]]; then
|
||||||
|
@ -339,6 +333,11 @@ createsite() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo cp /opt/webinoly/templates/template-site-php /etc/nginx/sites-available/$domain
|
sudo cp /opt/webinoly/templates/template-site-php /etc/nginx/sites-available/$domain
|
||||||
|
|
||||||
|
# Remove www support for subdomains - only main domain will support both www and non-www.
|
||||||
|
if [[ $subdomflag == 1 ]]; then
|
||||||
|
sudo sed -i "s/ www.domain.com;/;/g" /etc/nginx/sites-available/$domain
|
||||||
|
fi
|
||||||
|
|
||||||
# Nginx conf file for the new site (-php conf is default)
|
# Nginx conf file for the new site (-php conf is default)
|
||||||
sudo sed -i "s/domain.com/$domain/g" /etc/nginx/sites-available/$domain
|
sudo sed -i "s/domain.com/$domain/g" /etc/nginx/sites-available/$domain
|
||||||
|
|
Loading…
Reference in a new issue