-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add note for index.php change #8549
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The internet is full of these types of videos, I am shocked every time I see them.
It seems that because shared hosts are used, it is practically not possible to set Document Root
from cPanel or etc . So they have to do this.
It is better to link these explanations together with the explanations given in Shared Hosts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a link to a forum article. It seems the way in the article is a bit bothersome, but a better way for shared hosts that cannot set the document root.
This blog article also does the same way.
https://medium.com/@ayushbulbule/how-to-deploy-your-codeigniter-4-website-to-hostinger-cpanel-f66e84dfc45b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you can set the document root with cPanel, but the procedure is complicated:
https://support.cpanel.net/hc/en-us/articles/360055211213-How-to-change-the-document-root-of-the-primary-domain
It is simpler for 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I upload the project in public_html.
Then I create a file public_html/.htaccess in the root of the project and fill it with the following code.
The project is now available via https://mydomain.com/ instead of https://mydomain.com/public/.
Exactly the same as in Adding .htaccess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That method is fine as long as Apache's
.htaccess
works fine.However, it places files in the public area that do not need to be made public, and then adds rules to prevent access to certain files.
If we follow security principles, we should only place files in the public area that are likely to be accessed from the beginning.
This is because if there is a bug in Apache or if you accidentally modify
.htaccess
, files that should not be publicly accessible could be accessed.That said, the method described in the forum, where the folder structure changes between the development (repository) folder structure and the production server folder structure, is also a bit complicated to deploy.
It is best if you can specify the document root as
public
in the server configuration.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sent another PR #8554 to add docs about Shared Hosting Services.