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

chore: add .htaccess in project root #7676

Closed
wants to merge 1 commit into from

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Jul 7, 2023

Description
Currently, if the baseURL contains a subfolder, it is difficult to deploy, e.g., on shared servers that you can't edit httpd.conf.

E.g.

└── htdocs
    └── ci436 (project folder)
        └── public

Before:
Screenshot 2023-07-07 17 31 17

After:
Screenshot 2023-07-07 17 31 26

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

@iRedds
Copy link
Collaborator

iRedds commented Jul 7, 2023

I'll be honest. I don't like it.

@michalsn
Copy link
Member

michalsn commented Jul 7, 2023

I think I'd rather see this in the user guide than shipped with the framework.

@kenjis
Copy link
Member Author

kenjis commented Jul 7, 2023

@iRedds I agree that this is not good solution. How would you deploy CI4 app in the situation?

  • baseURL has a subfolder.
  • You cannot modify httpd.conf.

@ddevsr
Copy link
Collaborator

ddevsr commented Jul 8, 2023

I think this better for documentation, how to deploy project root as webroot without public using .htaccess

@iRedds
Copy link
Collaborator

iRedds commented Jul 8, 2023

@kenjis
We place the application in the parent directory for "htdocs" (domain directory).
The content of the "public" directory is copied to "ci436"
In "index.php" change the path.

@luckmoshy
Copy link

luckmoshy commented Jul 9, 2023

I do this to achieve that but i `don't think that if can be clear of.. let say if there is share apps what will also be
like ..I can do like this any way but......

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

@kenjis
Copy link
Member Author

kenjis commented Jul 11, 2023

I sent a PR #7680 to update docs.

#7676 (comment)
That is a correct way, but isn't it bothersome?
Do you think the way is documented in the user guide?

@kenjis
Copy link
Member Author

kenjis commented Jul 27, 2023

Closed by #7680

@kenjis kenjis closed this Jul 27, 2023
@kenjis kenjis deleted the add-htaccess branch July 27, 2023 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants