Welcome Guest, Not a member yet? Register   Sign In
Apache and sub folder
#1

I have an old CI3 site on /, and the new CI4 site on /beta. They are both running Apache and I'm tring to get .htaccess to work. I want of course to go to /beta/public/index.php no matter the URL. And the old site should run just as it does today.

It more or less looks like this in /beta/.htaccess:
Code:
<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /beta/public/
   
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]
</IfModule>

The baseURL is https://www.mydomain.com/beta/.

When I visit /beta/area where Area is a controller, it says Controller or its method is not found: \App\Controllers\Beta::area. Why does it still assume that Beta is a controller?

If I visit /beta/ I get HTTP 403: Access denied. 

Any help would be greatly appreciated.
Reply
#2

i've got CodeIgniter 4.0.0.4 working both live and I have a few dev web projects running basically as sub directories on apache on Slackware Linux.

The only edit i had to do with .htaccess was with going from http to https.

The only issue i recently had live was to do with permissions on the index.php in public.

i uploaded and got "forbidden on this server" i changed chmod permissions on index.php from 777 to 644 and that fixed it.

But i think maybe  its the approach to CI4 for you ? and the change that a web is now "served"  from the public directory and not root directory of web app.

If its any help i could go into  how i set mine up ...
Reply




Theme © iAndrew 2016 - Forum software by © MyBB