See https://codeigniter4.github.io/CodeIgniter4/installation/running.html#id4
When I navigate to http://localhost/ci4/users/
, I am redirected to http://localhost/ci4/public/users
.
.htaccess
:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
<FilesMatch "^\.">
Require all denied
Satisfy All
</FilesMatch>
--- a/public/.htaccess
+++ b/public/.htaccess
@@ -17,14 +17,14 @@ Options -Indexes
# RewriteBase /
# Redirect Trailing Slashes...
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_URI} (.+)/$
- RewriteRule ^ %1 [L,R=301]
+ #RewriteCond %{REQUEST_FILENAME} !-d
+ #RewriteCond %{REQUEST_URI} (.+)/$
+ #RewriteRule ^ %1 [L,R=301]
# Rewrite "www.example.com -> example.com"
- RewriteCond %{HTTPS} !=on
- RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
- RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
+ #RewriteCond %{HTTPS} !=on
+ #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
+ #RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the