tvakrep

Member
Nov 20, 2018
6
0
1
trabzon
cPanel Access Level
DataCenter Provider
Kök dizini nasıl değiştiririm .. example.com

alt etki alanı değil

domain example.com Kök dizini nasıl değiştiririm .. publich_html genel değiştir

domain example.com How to change root directory .. /publich_html change /public

no subdomain xxx.example.xom
 
Last edited by a moderator:

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
157
168
New Jersey
cPanel Access Level
DataCenter Provider
So this translator isn't good but if I understand correctly:

Code:
sed -e '/^documentroot:.*public_html$/{s/public_html/public/g'} /var/cpanel/userdata/*/*
Definitely test it out, once you are ready to make the actual change you can add -i:

Code:
cp -rf /var/cpanel/userdata /var/cpanel/userdatabk
sed -ie '/^documentroot:.*public_html$/{s/public_html/public/g'} /var/cpanel/userdata/*/*
/scripts/rebuildhttpdconf
/scripts/restartsrv_apache
This will only change the doc root if it ends in public_html so it will not affect subdomains or addon domains, unless they are pointed to public_html.
 

tvakrep

Member
Nov 20, 2018
6
0
1
trabzon
cPanel Access Level
DataCenter Provider
my domain name example.com hosting www.example.com open no /public_html
i want www.example.com open /public root file
How to change root directory no /public_html yes /public
 

Attachments

Last edited by a moderator:

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
157
168
New Jersey
cPanel Access Level
DataCenter Provider
edit the files:

/var/cpanel/userdata/cpusername/domain.com
/var/cpanel/userdata/cpusername/domain.com_SSL

change the path for 'documentroot'

then run:

Code:
/scripts/rebuildhttpdconf
/scripts/restartsrv_apache