안녕하세요 CI4 셋팅 때문에 일주일 동안 고생하고 있습니다. 거의 마무리 인것 같은데 잘 안되네요..
경험 많으신 분들 도움을 구합니다.
환경
mac os 에 기본으로 인스톨 되어 있는 apache 2.4 및 php 7.4 를 사용합니다.
apache httpd.conf 수정사항
<Directory "/Library/WebServer/Documents/api/public">
DirectoryIndex index.html index.htm index.php
# Options indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
======================
<Directory />
AllowOverride All
Require all denied
</Directory>
========================
.htaccess 내용
<IfModule mod_rewrite.c>
RewriteEngine On RewriteBase /
RewriteCond $1 !^(index\.php|images|captcha|data|include|uploads|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
위와 같은 설정으로 접근시
internal error가 나머 에러 로그를 보면
[Thu Mar 12 10:36:41.611590 2020] [core:error] [pid 8764] [client 127.0.0.1:62704] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
위와 같은 메시지가 나네요..
물론 http://apiserver/index.php/users 이런식으로 접근하면 이상없이 잘 나옵니다.
미리 감사 드립니다.
감사 드립니다...
github https://github.com/codeigniter4/CodeIgniter4
에 public 폴더의 .htaccess 파일의 내용을 그대로 넣었더니 해결 되었습니다...
htaccess 파일 내용이 3점대 버전 내용입니다. 저걸 사용하시는 이유가 있을까요?
ci4를 git이나 composer로 설치하면 기본적으로 htaccess가 포함됩니다.