point a domain to a path

ai8

Verified User
Joined
Mar 14, 2021
Messages
31
A domain needs to be directed to a path, e.g.
domain1.com
to serve files from
domain1.com/mypaths/path4domain1
as the base path (i.e. show only domain1.com in the URL address field of the browser).

Once one goes deeper into e.g.
domain1.com/mypaths/path4domain1/subdir
it would show domain1.com/subdir in the URL address bar.

How can above redirection/designation be done using DA?

Many thanks!
 
Last edited:
I don't understand the problem. Normally this is the default setup, files will be served from:
/home/user/domains/domain1.com/public_html
when the domain is visited, in the URL address only domain1.com is visible, so that is already like you ask.
It will be shown in the browser URL bar as https://domain1.com

Now if you create a subdir in that folder so it will become:
/home/user/domains/domain1.com/public_html/subdir
then in the browser it will show in the URL address bar of the browser as https://domain1.com/subdir which is also what you want.

This is the default, so it normally always works like this. So I don't really understand the issue you're having.
 

Attachments

  • Screenshot 2021-07-30 at 14-58-21 cPanel - Domains v2.JPG
    Screenshot 2021-07-30 at 14-58-21 cPanel - Domains v2.JPG
    31.4 KB · Views: 11
  • Screenshot 2021-07-30 at 14-58-39 cPanel - Addon Domains.png
    Screenshot 2021-07-30 at 14-58-39 cPanel - Addon Domains.png
    20.2 KB · Views: 11
  • Screenshot 2021-07-30 at 14-58-59 cPanel - Subdomains v2.JPG
    Screenshot 2021-07-30 at 14-58-59 cPanel - Subdomains v2.JPG
    44 KB · Views: 10
Last edited:
Thinking this is possibly what you want:


I do this for some customers that run some frameworks that place the actual web root a level or two down.

Otherwise it would be possible to construct an .htaccess file, to basically do the same thing. It's just more tricky.
 
Thinking this is possibly what you want:


I do this for some customers that run some frameworks that place the actual web root a level or two down.

Otherwise it would be possible to construct an .htaccess file, to basically do the same thing. It's just more tricky.
Yup could help, to have it only for one subdomain https://help.directadmin.com/item.php?id=199

Nwer knowledge base you can search more easy there https://docs.directadmin.com/webser...odify-the-open-basedir-setting-for-one-domain

Should be in GUI now : "For DirectAdmin versions prior to Version 1.61.0 (before the GUI was added),"
 
Last edited:
How can this be done in DA?
As described, this will be done automatically when creating a subdir.
However, it will be both reachable via subdir.domain.com and domain.com/subdir for visitors. If that is not what you want, then the solutions given by cjd and ikkeben should fix that for you.
 
Thank you for the above everyone!

Still after a solution.
It needs to be doable for the user (not reseller or admin/root) via GUI and work for both (sub- and) domains.

Hoping it will be implemented soon.
 
Back
Top