You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: user_guide_src/source/installation/running.rst
+81Lines changed: 81 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -426,6 +426,87 @@ Setting Environment
426
426
427
427
See :ref:`Handling Multiple Environments <environment-nginx>`.
428
428
429
+
430
+
.. _deployment-to-shared-hosting-services:
431
+
432
+
*************************************
433
+
Deployment to Shared Hosting Services
434
+
*************************************
435
+
436
+
.. important::
437
+
**index.php** is no longer in the root of the project! It has been moved inside
438
+
the **public** folder, for better security and separation of components.
439
+
440
+
This means that you should configure your web server to "point" to your project's
441
+
**public** folder, and not to the project root.
442
+
443
+
Specifying the Document Root
444
+
============================
445
+
446
+
The best way is to set the document root to the **public** folder in the server
447
+
configuration::
448
+
449
+
└── example.com/ (project folder)
450
+
└── public/ (document root)
451
+
452
+
For example, if you use cPanel, see:
453
+
454
+
- `How to change the document root of the primary domain <https://support.cpanel.net/hc/en-us/articles/360055211213-How-to-change-the-document-root-of-the-primary-domain>`_
455
+
- `How can I change the document root for an Addon Domain or Subdomain? <https://support.cpanel.net/hc/en-us/articles/360057802373-How-can-I-change-the-document-root-for-an-Addon-Domain-or-Subdomain>`_
456
+
457
+
Using Two Directories
458
+
=====================
459
+
460
+
The second way is to use two directories, and adjust the path.
461
+
One is for the application and the other is the default document root.
462
+
463
+
Upload the contents of the **public** folder to **public_html** (the default
464
+
document root) and the other files to the directory for the application::
465
+
466
+
├── example.com/ (for the application)
467
+
│ ├── app/
468
+
│ ├── vendor/ (or system/)
469
+
│ └── writable/
470
+
└── public_html/ (the default document root)
471
+
├── .htaccess
472
+
├── favicon.ico
473
+
├── index.php
474
+
└── robots.txt
475
+
476
+
See
477
+
`Install CodeIgniter 4 on Shared Hosting (cPanel) <https://forum.codeigniter.com/showthread.php?tid=76779>`_
478
+
for details.
479
+
480
+
Adding .htaccess
481
+
================
482
+
483
+
The last resort is to add **.htaccess** to the project root.
484
+
485
+
It is not recommended that you place the project folder in the document root.
486
+
However, if you have no other choice, you can use this.
487
+
488
+
Place your project folder as follows, where **public_html** is the document root,
0 commit comments