Turn off www-redirection for subdomains

Strator

Verified User
Joined
Jan 19, 2011
Messages
239
Hello everyone,

Today I learned the hard way that the "force redirect" domain management option will not only force mydomain.com to redirect to www.mydomain.com, but also subdomain.mydomain.com to www.subdomain.mydomain.com. It actually says that it will force redirect subdomains as well, so - fair enough. But is there an easy way to turn redirection off for the subdomains and only keep in for the main domain?

Thanks!
 
Code:
/usr/local/directadmin/directadmin set subdomain_force_redirect 0
service directadmin restart
 
Doesn't seem to work:

# /usr/local/directadmin/directadmin set subdomain_force_redirect 0
Error with the current values:
Cannot find 'subdomain_force_redirect' in the directadmin.conf
 
Last edited:
Btw, the "client" field is broken and doesn't autofill the uid on:

and doing doesn't work (using proper client and license id):

wget --no-check-certificate -O new.tar.gz 'https://www.directadmin.com/cgi-bin/daupdate?redirect=ok&uid=8602&lid=567890&channel=beta'

* You are not allowed to run this program *

I'm assuming the server provider would need to do this from their end.​

Hence, is there another way to achieve NOT redirecting SUB-DOMAINS to with "www." ?​

 
Maybe change the template and then rewrite the confs.
 
@duntuk u should mask the license and client ID if it's yours.

I'm assuming the server provider would need to do this from their end.​

Hence, is there another way to achieve NOT redirecting SUB-DOMAINS to with "www." ?​


Yes, only server provider can run this.

While waiting for the new stable version since you are not able to use pre-release version, I suggest you not to use redirect function from DA. So, set

Force redirect to No redirection


Then create an .htaccess to define redirection instead. With this you have full control over site redirection process. An example of an .htaccess that will redirect from non www to www:

Apache config:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]

This will not redirect subdomains.domain.com to www only the domain.com
 
Last edited:
Back
Top