I have domain somedomain.net which is linked to some IP 123.45.67.89
I need to have such subdomains:
in apache.conf I have such record:
<VirtualHost *:80>
DocumentRoot "/www/somedomain.net"
ServerName somedomain.net
ServerAlias www.somedomain.net
ServerAlias sub.somedomain.net
ServerAlias *.sub.somedomain.net
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*)\.somedomain\.net$
RewriteRule ^(.*)$ http://somedomain.net [R,L]
</VirtualHost>
But I have 404 error while opening http://sub.somedomain.net
In my domain admin-panel I have such records:
somedomain.net IN A 123.45.67.89
somedomain.net IN NS1 ns1.domain-seller.com.
somedomain.net IN NS2 ns2.domain-seller.com.
sub IN A 123.45.67.89
*.sub IN A 123.45.67.89
Where is my mistake? Thanks!
PS: I'm using dedicated server, so I can do any changes in configurations.
somedomain.net IN A 123.45.67.89
somedomain.net IN NS1 ns1.domain-seller.com.
somedomain.net IN NS2 ns2.domain-seller.com.
sub IN A 123.45.67.89
*.sub IN A 123.45.67.89
That looks wrong. If that's a bind file, you need to write sub.somedomain.net
and not sub
only.