how to activate wildard subdomains (all subs to one location)

remedia

New member
Joined
Nov 11, 2004
Messages
3
hello i have a website (www.mywebsite.com)

i want that -all- the subdomains are being forwarded/pointed to the startpage (one location: www.mywebsite.com)

so aaa.mywebsite.com ,zzz.mywebsite.com and all other (*.mywebsite.com) subdomains automaticly start at the same location. (www.mywebsite.com or www.mywebsite.com/index.html)

i know of the subdomain A (*) option in the dns option i activated this but all subdomain pages are forward to a welkome apache page (wich i can`t locate).

also i know the subdomains and add domains option in the admin but these only work for one domain.(and i need all subs)

goals is to get all (sub)domains started at one location and forward these by a (php)script to the correct locations.

please help /or give a pointer,. how to do this,.
i realy need this functionality active,.

thanks,.
Ronald
 
Easiest way is to have the domain on it's own IP#; then the wildcard (*) entry in DNS will work as long as it's pointed to the same IP#.

Jeff
 
Here you go:
Code:
#!/bin/bash

if [ $# -lt 2 ]; then
	echo "Usage:  $0 username domainname"
	exit;
fi
sed -e "s/DocumentRoot \/home\/$1\/domains\/$2\/public_html.*/DocumentRoot \/home\/$1\/domains\/$2\/public_html/g" /usr/local/directadmin/data/users/$1/httpd.conf >| /usr/local/directadmin/data/users/$1/httpd.conf.tmp
mv -f /usr/local/directadmin/data/users/$1/httpd.conf.tmp /usr/local/directadmin/data/users/$1/httpd.conf
chmod 644 /usr/local/directadmin/data/users/$1/httpd.conf
chown diradmin:diradmin /usr/local/directadmin/data/users/$1/httpd.conf
 
Last edited:
(Don't forget to /sbin/service httpd reload or /sbin/service httpd restart)
 
Back
Top