RE: subdomain with www is not working !!!!
08-10-2018, 04:41 PM
(This post was last modified: 08-10-2018, 04:57 PM by yusha.)
Quote:NOTICE: This fix is not recommended or approved by the Sentora Team. Use at your own risk.
Changing the core code of Sentora is not the proper way to solve this!
Proper Solution -HERE-
I think we don't have to wait for the next update. I figured it out.
Here's what you have to do. go to
Code:
/etc/sentora/panel/modules/sub_domains/code/
Code:
controller.ext.php
Code:
// Check to make sure the domain is in the correct format before we go any further...
if (strpos($domain, 'www.') === 0) {
self::$error = TRUE;
return FALSE;
}
Now you'll be able to add
Code:
www.subdomain.yoursite.com
Code:
<?php
if(!strstr($_SERVER['HTTP_HOST'],'www.'))
return;
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://'.substr($_SERVER['HTTP_HOST'],4).$_SERVER['REQUEST_URI']);
exit();
?>
or can assign that domain to the existing directory of your subdomain.
If you are using cloudflare free plan then you have to unmask the
Code:
www.subdomain A record