Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion

New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

cPanel + Git + Subdirectories = confusion..?!

XNQXNQ Veteran

Hey y'all,

I'm running into a weird issue while moving some sites from a DirectAdmin to cPanel setup, specifically one that is primarily static but has to be git controlled.

I've added the domain through cPanel -> Domains, and set the document root to /repositories/sitename

After that I created two different repos through cPanel > Git Version Control.
Repo 1, branch main:
"sitename", repo path being "/home/user/repositories/sitename"
This works when visiting through a hosts change and site is loading super fast, verified with custom headers added that it's loading from the correct place.. all fine and dandy.

Next up, repo 2, branch subdir:
"sitename_subdir", repo path being /home/user/repositories/sitename/subdir
Cloning the repo works, and the correct folder (subdir) is being created along with all files being there, great. However, it does not work, when visiting sitename.com/subdir I just get a 404. It does not seem to read any of the .htaccess headers for the subdir either.

Am I missing something completely, or shouldn't this just.. work? Is it some cPanel craziness?

I'm going insane..

Thanked by 1emgh

Comments

  • emghemgh Veteran, Megathread Squad

    Lycka till broder
    Eng: lucky to bridge

    Thanked by 1XNQ
  • emghemgh Veteran, Megathread Squad
    edited March 2025

    Create a index.html in the subdir

    Can you now load sitename.com/subdir/index.html ?

    If no

    Temp remove any weird htaccess

    Try again

    Thanked by 1XNQ
  • XNQXNQ Veteran

    @emgh said:
    Create a index.html in the subdir

    Can you now load sitename.com/subdir/index.html ?

    If no

    Temp remove any weird htaccess

    Try again

    No bueno. I did add this header to my subdir site: Header Set Site: "subdir" and a similar one as "main" for my main site. curling the subdir/index.html, I see its pulling in main header instead..?? :D


    {11:34} ➭ curl -kIL https://sitename.com/index.html HTTP/2 200 content-type: text/html last-modified: Wed, 26 Mar 2025 12:01:46 GMT accept-ranges: bytes content-length: 4851 date: Wed, 26 Mar 2025 15:34:57 GMT server: LiteSpeed site: main alt-svc: h3=":443"; ma=2592000, h3-29=":443"; ma=2592000, h3-Q050=":443"; ma=2592000, h3-Q046=":443"; ma=2592000, h3-Q043=":443"; ma=2592000, quic=":443"; ma=2592000; v="43,46" {11:34} ➭ curl -kIL https://sitename.com/subdir/index.html HTTP/2 404 date: Wed, 26 Mar 2025 15:35:00 GMT server: LiteSpeed site: main alt-svc: h3=":443"; ma=2592000, h3-29=":443"; ma=2592000, h3-Q050=":443"; ma=2592000, h3-Q046=":443"; ma=2592000, h3-Q043=":443"; ma=2592000, quic=":443"; ma=2592000; v="43,46"
  • emghemgh Veteran, Megathread Squad

    Did you try not doing anything custom htaccess wise?

    Because I refuse to believe with 0 changes a index.html in a site’s subdir doesn’t work

  • XNQXNQ Veteran
    edited March 2025

    @emgh said:
    Did you try not doing anything custom htaccess wise?

    Because I refuse to believe with 0 changes a index.html in a site’s subdir doesn’t work

    Correct:

    [sitename@hodor repositories]$ cat sitename/.htaccess
    Header Set Site: "main"
    [sitename@hodor repositories]$ cat sitename/subdir/.htaccess
    Header Set Site: "subdir"
    

    I've tried to also run curl with --resolve flags to make sure it's loading from the correct server but yeah, no, I'm at a loss lol.

    Edit:
    oh and before "you don't even have the filesZ11!!"

    [sitename@hodor repositories]$ find . -iname "index.html"
    ./sitename/subdir/index.html
    ./sitename/index.html
    
Sign In or Register to comment.