This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

subdomain with www is not working !!!!
#11
RE: subdomain with www is not working !!!!
(08-10-2018, 04:41 PM)yusha Wrote: 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/
and edit
Code:
controller.ext.php
and just comment out this code with /* */ at line 218
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 www.subdomain.yoursite.com as an individual subdmoain and can create a new directory and redirect that page into the one without www using this code as your index for that newly created directory
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.

Nice, glad you figured it out. I'll be testing it later after I finish my work.
Good day!
***********************************************
SAMUEL AVOLA MUNGUJAKISA         *
CEO, Bero Computers                         *
www.berocomputers.com          *
+256754086797                           *
+256780585402                     *
*****************************  *
Reply
Thanks given by:


Messages In This Thread
subdomain with www is not working !!!! - by yusha - 08-06-2018, 05:07 AM
RE: subdomain with www is not working !!!! - by mungujakisa - 08-10-2018, 04:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Public_html Inside Domain/Subdomain zHostingSolutions 2 5 ,031 07-23-2021, 09:57 AM
Last Post: Nigel
redirect error after letsencrypt + subdomain mizerek 1 4 ,839 08-06-2020, 04:54 AM
Last Post: mizerek
Add on Domains not working but Main domain works luckyviet 2 6 ,382 03-18-2020, 07:38 PM
Last Post: AanaNahum

Forum Jump:


Users browsing this thread: 7 Guest(s)