Help to find the correct approach to a wildcard virtual host configuration

rodolfostein

Registered
Sep 22, 2020
1
0
1
Ouro Preto / Minas Gerais / Brazil
cPanel Access Level
Root Administrator
Hello, I am new in cpanel world and need help to solve a problem.

I have the following scenario.

We sell a product to many customers.... this system was confiured in a standalone machine (no cpanel)... I need to configure it in cpanel.

the url for each customer is in the form http://customer1.mycompany.com http://customer2.mycompany.com etc.

in the filesystem, each customer has a specific subdirectory for example:
<app_configuration> \
\customer1
\customer2
.....
\customerN

I am trying to configure cpanel to handle this....
1) First I configure a wildcard subdomain *.mycompany.com and points to /<app_configuration> directory.
2) now I am trying to configure a special vhost configuration to be included that can do this apache command:
VirtualDocumentRoot /<app_configuration>/%1/
But a don´t have success...

I think that a .htaccess file can handle too, but I don´t have enough knowledge for this and don´t found any example in the web... some tutorials that I found are superficial.

Can anyone help me ?
Thank in advance.
Rodolfo
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,266
313
Houston
Because cPanel relies on the accounts being added through the interface, doing anything manually like you're trying to do would most likely result in unpredictable results. Once the accounts are added you can use VirtualHost includes to point to specific but really you should look at containing everything in the user's home directory -> /home/$user/

This is really something that would be benefitted by a qualified system administrator or web developer who is familiar with cPanel. If you don't have an administrator you might find one here: System Administration Services