commit 6b686b9 code中文原文

How to Set Up Wildcard Domains in DirectAdmin

Author
Yujia Lin
Date
Reading time
1 min read

Translated from Chinese by Claude. Read the original

This was something from a month ago. I installed WordPress on a DirectAdmin panel and turned on Multisite. Since DirectAdmin doesn’t support adding * subdomains, you have to edit the config file by hand, which is what this post is about. To set it up for a single domain, first log in over SSH (you need root) and enter the following commands, replacing yourdomain.com with your own domain

1
2
cd /usr/local/directadmin/data/users/yourdomain/
vi httpd.conf

Find ServerAlias www.yourdomain.com yourdomain.com

Add this after it: *.yourdomain.com

So it becomes ServerAlias www.yourdomain.com yourdomain.com *.yourdomain.com

Save, restart Apache, and your wildcard record takes effect. PS: I’ve noticed I’m getting used to writing posts in HTML…… the visual editor is garbage……

Esc

Keyboard shortcuts

Ctrl K /
Search and commands
j k
Next or previous post in a list
Enter
Open the selected post
h l
Older or newer post (on a post)
g h
Go to the log
g a
Go to the archive
g t
Go to tags
g s
Go to stats
t
Switch light or dark theme
r
Random post
?
Show this help