![]() |
|
subdomain with www is not working !!!! - Printable Version +- Sentora Support Forums (https://senforums.mach-hosting.com) +-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5) +--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32) +---- Forum: General Support Forum v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=36) +---- Thread: subdomain with www is not working !!!! (/showthread.php?tid=10120) Pages:
1
2
|
subdomain with www is not working !!!! - yusha - 08-06-2018 Hello guys! So far all the domains I add are actually working with www but not the subdomians. I am using cloudflare and when I create a subdomain I always create the subdomain.mysite.com and Code: www.subdomain.mysite.comI have also tried with Code: www.subdomain to cname mysite.comIs there any solution for this? I wanted my subdomain.mysite.com to work with www.subdomain.mysite.com as well. RE: subdomain with www is not working !!!! - TGates - 08-07-2018 There are a few posts related to this somewhere. Yet, @[Me.B] uses cloudflare and may be of more help. RE: subdomain with www is not working !!!! - yusha - 08-07-2018 @TGates Believe me I have checked out all the posts related to this. But not finding a proper solution. Some posts tells you to do some changes on .htaccess some post tells you to change the config on apache. Some posts tells you to create page rules. Tried with everything I have found. But none is working. I am thinking if there's any way to add the subdomain with www as an additional subdomain but sentora is not allowing me to do so. So If I can add Code: subdomain.mysite.comCode: www.subdomain.mysite.comCode: www.subdomain.mysite.comCode: subdomain.mysite.comSo @TGates what are the modification that I have to do in Sentora's config files to make it happen? RE: subdomain with www is not working !!!! - mungujakisa - 08-07-2018 (08-07-2018, 08:02 AM)yusha Wrote: @TGates Believe me I have checked out all the posts related to this. But not finding a proper solution. Some posts tells you to do some changes on .htaccess some post tells you to change the config on apache. Some posts tells you to create page rules. Tried with everything I have found. But none is working. Add that in the /etc/sentora/configs/apache/httpd-vhosts.conf where you will find the subdomains referenced, and that is the file called by the main apache config. I think you'll need a ServerAlias www.your.subdomain.com I believe you should update your host dns records as well for it to work. I might test it later and confirm. RE: subdomain with www is not working !!!! - yusha - 08-07-2018 (08-07-2018, 03:05 PM)mungujakisa Wrote: Add that in the /etc/sentora/configs/apache/httpd-vhosts.conf where you will find the subdomains referenced, and that is the file called by the main apache config. I think you'll need a ServerAlias www.your.subdomain.com Yeah I have seen that file. Please Give me step by step method if it works for you RE: subdomain with www is not working !!!! - mungujakisa - 08-07-2018 (08-07-2018, 03:08 PM)yusha Wrote: Yeah I have seen that file. Please Give me step by step method if it works for you Note: Be careful while editing the vhosts file, this can cause apache to stop working if edited wrongly! Also I'm on Ubuntu, I hope it works on CentOS You can do this by performing the following steps:
RE: subdomain with www is not working !!!! - mungujakisa - 08-08-2018 hey Yusha, did this help? RE: subdomain with www is not working !!!! - yusha - 08-10-2018 (08-08-2018, 07:48 PM)mungujakisa Wrote: hey Yusha, did this help? yeah it eventually does but whenever I need to create a domain I need to do a lot of process like adding a record in dns zone editor, changing the vhost config, add the subdomain in sentora panel. Is there any quick way where I can bypass sentora's message and add www as an additional subdomain in subdomain section of sentora panel? RE: subdomain with www is not working !!!! - mungujakisa - 08-10-2018 (08-10-2018, 03:08 PM)yusha Wrote: yeah it eventually does but whenever I need to create a domain I need to do a lot of process like adding a record in dns zone editor, changing the vhost config, add the subdomain in sentora panel. This is just a work-around; I've not seen that option in Sentora yet, and I'm no expert; I think it should be included in the next version of Sentora among other features I'm thinking of. Have a blessed day. RE: subdomain with www is not working !!!! - yusha - 08-10-2018 Quote:NOTICE: This fix is not recommended or approved by the Sentora Team. Use at your own risk. 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.phpCode: // 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.comCode: <?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 |