CodeIgniter Forums
CI4 and sub-domain (xxx.domain.tld) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: CI4 and sub-domain (xxx.domain.tld) (/showthread.php?tid=92459)



CI4 and sub-domain (xxx.domain.tld) - Gian - 02-13-2025

Hello, everyone,
I have proceeded to install CI4 via Composer on a sub-domain as in the subject.

When the procedure is completed, I get a 403 instead of the Welcome Page.

If I set a .htaccess file in the root with the following parameter:

Code:
DirectoryIndex /public/index.php


it loads the Welcome Page but everything else returns a 500 error.

Any suggestions?


RE: CI4 and sub-domain (xxx.domain.tld) - grimpirate - 02-13-2025

You shouldn't need to modify any htaccess files at all. Your apache server should point to the public directory of your project and then everything should just work. Perhaps it is expecting index.php at the end of the URLs; without more details I would suggest reading Troubleshooting and seeing if anything there applies to your situation.


RE: CI4 and sub-domain (xxx.domain.tld) - captain-sensible - 02-13-2025

i agree with  @grimpirate  make sure all directories are permissions 755 and all individual files 644



on my hosting i have a fully fledged domain pointing to a sub-directory of main hosting ; on mine i have to add domain via "manage domain" , then add domain" and edit path  to point document root of  sub directory to be "public"

i presume you did all the usual stuff set   domain address in app/config/App.php  :


Code:
public string $baseURL = 'http://127.0.0.7/';

//abive is on local dev