Question
Prolem: subdomain redirect to maindomain
Hi,
I’m creating a new subdomain (sub.example.com) on the same droplet as my main domain (example.com). I’m able to ping the subdomain and check DNS (https://www.digitalocean.com/community/tools/dns). However, whenever I come to sub.example.com, it still redirect me to my main domain’s content (the bar still shows sub.example.com).
My main domain is a wordpress website.
My sub.example.com.conf on etc/nginx/sites-available:
server {
listen 80;
root /var/www/sub.example.com;
index index.html index.htm index.nginx-debian.html;
servername sub.example.com www.sub.example.com;
location / {
tryfiles $uri $uri/ =404;
}
}
Hosts file: myip sub.example.com
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×