Solved Custom HTTPD Config for subdomain

aidanoh

Verified User
Joined
Jan 15, 2023
Messages
9
Hi there,
I need to change a sub domain document root. I currently have my main domain setup like this. (domain.com for example)

|?DOCROOT=/home/admin/domains/domain.com/public_html/domain.com/public|

When I view the HTTPD config I can see the api.domain.com settings I'm just not sure how I modify the document root for the subdomain aswell,

Thanks!
 
you need if/else statement

Code:
|*if SUB="sub1"|

|*endif|
 
@Ohm J Oh I see, so the entire file would be this, correct?

Code:
|?DOCROOT=/home/admin/domains/domain.com/public_html/domain.com/public|

|*if SUB="api"|

|?DOCROOT=/home/admin/domains/domain.com/public_html/domain.com/public|

|*endif|
 
yes, but correct or not. you should checking on current virtualhost block data after apply customize config.
 
yes, but correct or not. you should checking on current virtualhost block data after apply customize config.
That didn't work for me... I checked virtual host block aswell it still redirects to the old document root
Can I use the same document root setter that I did for domain.com or does it need to change for the api.domain.com
 
Ahhh, it's should working, maybe you put on wrong customize block.

...ehhh nevermind, it's hardcoding inside template
1725414600684.png



just customize via GUI.
1725414705947.png
 
Ahhh, it's should working, maybe you put on wrong customize block.

...ehhh nevermind, it's hardcoding inside template
View attachment 8508


just customize via GUI.
View attachment 8509
Thank you that worked!

Another issue i've got is we've had to get a second IP onto our API and I can't set that IP just for the sub domain... I added it to the ip page but not sure how to get it in the doc root without it going onto the main domain aswell...
 
Back
Top