Skip to content
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 Apache config for baseURL with subfolder #7680

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Jul 8, 2023

Needs #7679

Description
Related #7676

  • add "Hosting with Subfolder"

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • User guide updated
  • [] Conforms to style guide

@kenjis kenjis added the documentation Pull requests for documentation only label Jul 8, 2023
@kenjis kenjis marked this pull request as draft July 8, 2023 02:09
@kenjis kenjis force-pushed the docs-apache-config-subfolder branch 2 times, most recently from 1d0b3d1 to b9fc026 Compare July 11, 2023 21:46
@kenjis kenjis marked this pull request as ready for review July 11, 2023 21:47
@kenjis kenjis force-pushed the docs-apache-config-subfolder branch from b9fc026 to db685b7 Compare July 11, 2023 21:52
@kenjis kenjis force-pushed the docs-apache-config-subfolder branch from db685b7 to d2511e5 Compare July 11, 2023 21:53
@kenjis kenjis mentioned this pull request Jul 11, 2023
2 tasks
@kenjis
Copy link
Member Author

kenjis commented Jul 25, 2023

Can someone review this?

@kenjis
Copy link
Member Author

kenjis commented Jul 26, 2023

Another config is posted in https://forum.codeigniter.com/showthread.php?tid=88021&pid=410949#pid410949

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC]
    RewriteRule ^ %1 [L,NE,R=302]
    RewriteRule ^((?!public/).*)$ public/$1 [L,NC]
</IfModule>

But we have the default .htacces in the public folder. So when I navigate to http://localhost:8888/myproject/public/,
it is used and the redirect to the URL without public does not work.

In the end, it seems that for a more appropriate configuration, it is necessary to put all settings in /myproject/.htaccess and delete /myproject/public/.htaccess.

That would make the configuration more complicated, so I think .htaccess in this PR is fine as a first step.

@kenjis kenjis merged commit 322fdd7 into codeigniter4:develop Jul 27, 2023
@kenjis kenjis deleted the docs-apache-config-subfolder branch July 27, 2023 00:08
@kenjis
Copy link
Member Author

kenjis commented Jul 27, 2023

@samsonasik Thank you for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests for documentation only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants