Forum Moderators: phranque
to go to the www. of my domain. (no subdomains at all)
Is this possible to do in DNS management in the CNAME field. ?
Do you get enough requests for the (nonexistent) m. subdomain that you want to capture and redirect them, rather than simply let the DNS send out a "can't find it" error messsage?
there is no way for a webmaster to know what DNS requests are being made for various subdomains.
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
This is the rule you've probably already got in some form. RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteCond %{HTTP_HOST} [a-z]+\.example\.com [NC]
RewriteRule .? - [G]
or something in my /conf/ file. (vhost.conf)
AddType application/x-httpd-php .php .html .htm
AddType application/x-httpd-php-source .phps
<Directory /var/www/vhosts/example.com/httpdocs>
Options ExecCGI
allow from all
</Directory>
<Directory /var/www/vhosts/example.com/httpdocs>
Options ExecCGI
allow from all
</Directory>