Welcome Guest, Not a member yet? Register   Sign In
Ci4 on subfolder
#1

Hi , sorry for english , i installed a ci4 application on subfolder , set the base url and the base controller .
If i go to base url (www.domain.com/ci4) i redirected to the base controller (user) and because im not logged to the user/login ( www.domain.com/ci4/user/login ) . If i modify the url eliminating login im redirecting to www.domain.com/user with 404 page why ?
Reply
#2

Hi, sorry for my english too !
For using ci4 in a subfolder I create a subdomain and modify the DNS to target the url I want.
After nothing special to do in ci4 installation.
Reply
#3

(This post was last modified: 11-24-2020, 06:55 PM by InsiteFX.)

You need to set your new path locations.

See .app/Config/Paths.php
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

(This post was last modified: 11-25-2020, 04:59 AM by pippuccio76.)

(11-24-2020, 06:55 PM)InsiteFX Wrote: You need to set your new path locations.

See .app/Config/Paths.php


this is my structure folder :

inside / 
-my_domain
-other domain

inside my_domain
-ci4

inside ci 4:
-assets
-codeigniter
-index.php

this is codeigniter:
-app
-system
-writable
-.env

Must i change config path ? it don't work if https://my_domain.com/ci4/user/login became https://my_domain.com/ci4/user/ the url became automatically https://my_domain.com/user  (without ci4).

if i see https://rxdental.resista-ds.it/ci4/ automatically became https://rxdental.resista-ds.it/ci4/user/login (because user it's the default controller login because im not autenticated)
Reply
#5

Your bas3e_url should be like this, I really don't understand why users keep move CodeIgniter
arround? You can keep the same structure and then just drop it in a sub folder and set the
base_url.

PHP Code:
// .app/Config/App.php
public $baseURL 'https://my_domain.com/ci4/'
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#6

I had troubles in the past setting up CI4 in a subdirectory like you did. There was some bugs with the redirections, even if the baseURL is correctly configured. I highly recommend you set up a subdomain like ci4.mydomain.com instead of a subdirectory. It will save you some headaches!
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB