subdomain with www is not working !!!!
#6
RE: subdomain with www is not working !!!!
(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:
  1. Open /etc/sentora/configs/apache/httpd-vhosts.conf using your favourite editor (I prefer nano). Scroll down till you find the record for your subdomain, which will look like #DOMAIN: sub.domain.comĀ 
  2. Add a new line under the "ServerName" line
    Code:
    ServerAlias www.sub.domain.com


  3. save the file and exit the editor.
  4. Go to your host DNS editor (not the one of Sentora) and add an A record. If your subdomain is sub.domain.com, then the A record should be "sub" (leave quotes out) and point to your public IP address. Your DNS should already have a www entry for your main domain, so you can leave it as it is or add it if missing.
  5. Restart Apache. For me since I'm on ubuntu, I use
    Code:
    service apache2 restart


  6. Test and see if it works. If it doesn't, you may need to clear your cache; for me I tested on another browser instead of clearing my cache and losing temporary files, it works perfectly.
Hope this is clear enough; cheers!
Reply


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-07-2018, 03:39 PM

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

Forum Jump:


Users browsing this thread: 1 Guest(s)