Skip to content

Commit

Permalink
docs: fix sample .htaccess
Browse files Browse the repository at this point in the history
The settings may redirect to URI with `/public/`.
E.g., http://localhost/ci4/users/ -> http://localhost/ci4/public/users
  • Loading branch information
kenjis committed Mar 31, 2024
1 parent 67fa536 commit b559dbd
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions user_guide_src/source/installation/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,30 @@ And edit **.htaccess** as follows:
Satisfy All
</FilesMatch>
And remove the redirect settings in **public/.htaccess**:

.. code-block:: diff
--- a/public/.htaccess
+++ b/public/.htaccess
@@ -16,16 +16,6 @@ Options -Indexes
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
# RewriteBase /
- # Redirect Trailing Slashes...
- 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]
-
# 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
# request to the front controller, index.php
Hosting with mod_userdir (Shared Hosts)
=======================================

Expand Down Expand Up @@ -505,6 +529,31 @@ And edit **.htaccess** as follows:
Satisfy All
</FilesMatch>
And remove the redirect settings in **public/.htaccess**:

.. code-block:: diff
--- a/public/.htaccess
+++ b/public/.htaccess
@@ -16,16 +16,6 @@ Options -Indexes
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
# RewriteBase /
- # Redirect Trailing Slashes...
- 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]
-
# 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
# request to the front controller, index.php
*********************
Bootstrapping the App
*********************
Expand Down

0 comments on commit b559dbd

Please sign in to comment.