Welcome Guest, Not a member yet? Register   Sign In
CI4 in a shared host subfolder
#7

(06-14-2023, 01:34 AM)kenjis Wrote: Navigate to http://dimas.cat/eventplanr/img/logo-192x192.png , you see "Can't find a route for 'get: /img/logo-192x192.png'. "
Exact, but if you go to http://dimas.cat/eventplanr/public/img/logo-192x192.png it works. How can I redirect it?

(06-14-2023, 01:34 AM)kenjis Wrote: So your .htaccess config is something wrong.
All requests are routed to CI4 and the web server cannot serve images files.
This is my http://dimas.cat/eventplanr/.htaccess , is it wrong?

Code:
# Disable directory browsing
Options -Indexes

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On

    # 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
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]

    # Ensure Authorization header is passed along
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Hide index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    ErrorDocument 404 index.php
</IfModule>

# Disable server signature start
    ServerSignature Off
# Disable server signature end
Reply


Messages In This Thread
CI4 in a shared host subfolder - by dimas - 06-13-2023, 06:13 PM
RE: CI4 in a shared host subfolder - by kenjis - 06-13-2023, 07:09 PM
RE: CI4 in a shared host subfolder - by dimas - 06-13-2023, 11:52 PM
RE: CI4 in a shared host subfolder - by kenjis - 06-13-2023, 07:12 PM
RE: CI4 in a shared host subfolder - by kenjis - 06-14-2023, 01:10 AM
RE: CI4 in a shared host subfolder - by kenjis - 06-14-2023, 01:34 AM
RE: CI4 in a shared host subfolder - by dimas - 06-14-2023, 02:35 AM
RE: CI4 in a shared host subfolder - by kenjis - 06-14-2023, 03:28 PM
RE: CI4 in a shared host subfolder - by dimas - 06-14-2023, 03:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB