A small question in regards to subdomains on DirectAdmin.

BakkerM

Verified User
Joined
Jul 10, 2015
Messages
33
Hi guys (new here),

But I am experiencing some difficulties with subdomains on DirectAdmin (my English is rather poor, so let apologize up front).
I am normally kinda used to Plesk (sorry for the foul language :eek:), so DirectAdmin is kinda "hard" on me.

Okay, this is what I am trying to achieve. I created a subdirectory called 'subdir' to my domain.com. So this results in 'subdir.domain.com'
If I now add an index to the directory, how can I load the stuff (like CSS, images and so on) from the main directory (public_html)?

Maybe this will make it a bit clearer. I got contents in domain.com, for example exampleimage.jpg
How do I call this image from the subdirectory? So that the index.php in subdir.domain.com can load the image (exampleimage.jpg) from domain.com.

Once again I apologize if my intentions are not clear, but for some reason I am experiencing tons of problems here. :(

Maybe I overlooking something, or I am taking the wrong approach, or thinking to difficult.

Can anyone explain. Thank you in advance.

Regards
 
(sorry couldn't edit my previous post)

I just uploaded an index.php to the subdir. When I check the index.php it tries to load the image from: http://subdir.domain.com/images/exampleimage.jpg
Though it should load the image from the original, main directory, which would be: http://domain.com/images/exampleimage.jpg

I could always ofcourse change the paths for all CSS, JS and images in the index.php (in subdir) to the full URL, like: http://domain.com/images/exampleimage.jpg, http://domain.com/css/style.css, http://domain.com/js/jquery.js, etc...

...however I don't think thats the correct way to achieve this, right?
 
Hello,

If you don't want to use absolute URLs in favor of relative URLs (What is the difference between an absolute and a relative URL?
https://kb.iu.edu/d/abwp) then you should either use mod_rewrite or create symlinks from public_html/css/ to public_html/subdir/css/ (etc).
 
Okay thank you. I think I will look into mod_rewrite then to see if that is doable for me. :)
 
Back
Top