how to install CI4 in sub folder in shared hosting? |
How to install CI4 in sub folder in shared hosting?
I want to access by this URL(without public folder): example.com/myapp/controller/method ...
You should set the "DocumentRoot" option in HTTPD.conf your server settings, Example:
DocumentRoot = "%siteDir%/myapp/public/" Or if you renamed the "public" folder to "myapp", then install something like this: DocumentRoot = "%siteDir%/myapp/" Where %siteDir% points to a domain folder. I would change this world, but God doesn't give me the source.
(09-28-2019, 04:08 AM)Digital_Wolf Wrote: You should set the "DocumentRoot" option in HTTPD.conf your server settings, Example: As i mentioned the host is shared... and we cannot edit HTTPD.conf... The host root dir contains some Apps folders and one of them is CI4: public_html/frameworkX/... public_html/frameworkY/... public_html/CI4/... Now, we want make CI4 URL access without 'public', like: example.com/CI4/controller/method ...
Try doing it in a file .htaccess which will be located in the folder pointed to by your server, if you look at ci4/public/.htaccess it says that you can set the base directory using the parameter "RewriteBase", and also provides a link to the official documentation for configuring the server files.
I would change this world, but God doesn't give me the source.
Finally i found a simple solution:
1- create index.php in the ci4 root folder that contain ( include 'public/index.php' ) 2- then copy public/.htaccess to the root folder
(09-28-2019, 11:58 PM)kingstyles Wrote: Finally i found a simple solution: You do not absolutely need a directory named "public". You can reorganize the directories like you want. You just need to have a public and a private directory. You can put all the content of the "public" directory anywhere you want, with the name you want, and then set the path for the private directory in index.php : Code: // Location of the Paths config file.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
(09-29-2019, 06:38 AM)includebeer Wrote:(09-28-2019, 11:58 PM)kingstyles Wrote: Finally i found a simple solution: Thanks alot
One additional measure to take in production environments is to disable PHP error reporting and any other development-only functionality. In CodeIgniter, this can be done by setting the ENVIRONMENT constant, which is more fully described on the environments page *SPAM link removed*
Here is the video tutorial that shows exactly the steps.
https://www.youtube.com/watch?v=k943H5OiIdE[Video: https://www.youtube.com/watch?v=k943H5OiIdE] |
Welcome Guest, Not a member yet? Register Sign In |