Welcome Guest, Not a member yet? Register   Sign In
Overriding Public Folder In Codeigniter via composer plugin
#1

(This post was last modified: 01-27-2017, 07:53 AM by koficypher.)

Hi,
i recently tried my hands on codeigniter composer installer by Kenjis. it had a directory structure like this;
codeigniter/
├── application/
├── composer.json
├── composer.lock
├── public/
│ ├── .htaccess
│ └── index.php
└── vendor/
└── codeigniter/
└── framework/
└── system/

I uploaded it into my www directory and i fired it up. I noticed that before i could actually see the welcome message i had to hada to navigate pass the public folder so i had something like this ; http://localhost/apple/public, before i could actually see the welcome message. Any ideas how to override that?
i want to see the welcome message at http://localhost/apple and not  http://localhost/apple/public.
Reply
#2

Move index.php and .htaccess to the root of your project.

Make sure $system_path, $application_folder and $view_folder point to the correct place in index.php

There may be more to do, I'm not familiar with that project.
Reply
#3

(01-27-2017, 09:28 AM)enlivenapp Wrote: Move index.php and .htaccess to the root of your project.

Make sure $system_path, $application_folder and $view_folder point to the correct place in index.php

There may be more to do, I'm not familiar with that project.

Thanks a lot. It worked
Reply
#4

Nooooo. Leave index.php and .htaccess inside /public.
Map your document root to the www/apple/public folder, instead of the www folder.
If you use virtual hosting to do this, then you could end up with http://apple.local, behaving as expected!
Reply
#5

Ah, um, yeah...

i should have said "while its bad practice..." and mentioned the right way.

*hangs head in shame*
Reply




Theme © iAndrew 2016 - Forum software by © MyBB