Welcome Guest, Not a member yet? Register   Sign In
CI3 - place index not in top directory [SOLVED]
#1

(This post was last modified: 06-23-2022, 04:29 PM by TheAdmiral.)

Hey there. I've got a couple different places I put my CI3 website. One of them (a version I use for testing) is at http://localhost/Folder1/Folder2/Folder3/. Having all those folders between localhost and the index.php file is confusing CodeIgniter and is resulting in it detecting the class as Folder1 and the method as Folder2.

So for example http://localhost/Folder1/Folder2/Folder3/class/method should be [class=class, method=method], not [class=Folder1, method=Folder2]

Is there a way to fix this without changing my directory structure? Help much appreciated.
Reply
#2

(06-22-2022, 04:58 AM)TheAdmiral Wrote: Hey there. I've got a couple different places I put my CI3 website. One of them (a version I use for testing) is at http://localhost/Folder1/Folder2/Folder3/. Having all those folders between localhost and the index.php file is confusing CodeIgniter and is resulting in it detecting the class as Folder1 and the method as Folder2.

So for example http://localhost/Folder1/Folder2/Folder3/class/method should be [class=class, method=method], not [class=Folder1, method=Folder2]

Is there a way to fix this without changing my directory structure? Help much appreciated.
What's your base URL?
Learning Codeigniter 
Reply
#3

$config['base_url'] = 'http://localhost/Marathon%20Volunteers/BitBucket/dev.titanvolunteers.com/';
Reply
#4

(This post was last modified: 06-22-2022, 05:30 AM by SubrataJ.)

(06-22-2022, 05:10 AM)TheAdmiral Wrote: $config['base_url'] = 'http://localhost/Marathon%20Volunteers/BitBucket/dev.titanvolunteers.com/';

your base URI is pretty much confusing, but as per your folder structure given by you, your base URL should be " http://localhost/Folder1/Folder2/Folder3/" for the project inside folder3.

if you have a git repo it would be much easier to assist.

and it's not a good practice to use space in a URI as a URI must not contain a literal space and must be encoded; a %20 is not a space but it represents a space.
Learning Codeigniter 
Reply
#5

Show your folder structure

index.php
-- application
-- system

You need to tell index.php where your application and system folders are located.


PHP Code:
index.php

// Normal folder structure
$system_path 'system';

$application_folder 'application';

// Custom folders structure
$system_path '../system';

$application_folder '../application';

.. 
up one folder 
What did you Try? What did you Get? What did you Expect?

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

localhost
--Marathon Volunteers
----BitBucket
------ci_dev
--------application
----------cache
----------config
----------controllers
----------etc.
--------test
--------vendor
----------codeigniter
------dev.titanvolunteers.com
--------index.php

$system_path = '../ci_dev/vendor/codeigniter/framework/system';
$application_folder = '../ci_dev/application';
Reply
#7

Got it. That space in the folder `Marathon Volunteers` was the cause of the bug. Renaming the folder to MarathonVolunteers fixed it. Thanks all for the ideas.
Reply
#8

I saw the space yesterday and was going to mention it to have you try changing it.

Please edit your post title and add [SOLVED] to the end of it.

Thank you.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB