Welcome Guest, Not a member yet? Register   Sign In
Codeigniter with several webs
#1

Hi, I want to use codeigniter as root of several webs, my question is about how to rewrite the URL with apache2 for the controllers!?

My webserver is an instance in AWS Lightsail, and I use Apache 2.4 and codeigniter 3.1.11
Reply
#2

I am not familiar with AWS Lightsale but do use an Apache2 VPS.

I have use common directory /var/www/ci2/  which contains the latest couple of CI Versions (and a few other common librarie).

Each CI domain has an index.php system link to the CI version system path.

I have set an index.php constant to the CI4 system path and set it in the App/Config/setup.php (I think from memory).

Tentatively tapped on a tablet Sad
Reply
#3

(02-28-2020, 05:43 PM)John_Betong Wrote: I am not familiar with AWS Lightsale but do use an Apache2 VPS.

I have use common directory /var/www/ci2/  which contains the latest couple of CI Versions (and a few other common librarie).

Each CI domain has an index.php system link to the CI version system path.

I have set an index.php constant to the CI4 system path and set it in the App/Config/setup.php (I think from memory).

Tentatively tapped on a tablet Sad

Can you please put the example of the index.php and setup.php files?
Reply
#4

@Entai

Try this and see if it answers your queries:

https://ci4-strict.tk/bugs-fixed
Reply
#5

(02-28-2020, 05:58 PM)John_Betong Wrote: @Entai

Try this and see if it answers your queries:

https://ci4-strict.tk/bugs-fixed

I need CI 3, had all the websites and controllers on that version Sad
Reply
#6

@Entai.

Code:
/*
*---------------------------------------------------------------
* SYSTEM DIRECTORY NAME
*---------------------------------------------------------------
*
* This variable must contain the name of your "system" directory.
* Set the path if it is not in the same directory as this file.
*/
# $system_path = 'system';
  # system_path = '/var/www/ci2/CodeIgniter-3-1-10/system';
  $system_path  = '/var/www/ci2/CodeIgniter-3-1-11/system';
Reply
#7

(02-28-2020, 08:06 PM)John_Betong Wrote: @Entai.

Code:
/*
*---------------------------------------------------------------
* SYSTEM DIRECTORY NAME
*---------------------------------------------------------------
*
* This variable must contain the name of your "system" directory.
* Set the path if it is not in the same directory as this file.
*/
# $system_path = 'system';
  # system_path = '/var/www/ci2/CodeIgniter-3-1-10/system';
  $system_path  = '/var/www/ci2/CodeIgniter-3-1-11/system';

yup, that works!, I use not only the system path also the application path too, and in each web folder I put the views ... but is not accessing my controllers (other than welcome!) ... something is wrong ... still researching what Tongue
Reply
#8

(02-28-2020, 01:18 PM)Entai Wrote: Hi, I want to use codeigniter as root of several webs, my question is about how to rewrite the URL with apache2 for the controllers!?

My webserver is an instance in AWS Lightsail, and I use Apache 2.4 and codeigniter 3.1.11
[off-topic]
Unable to reply to your message because the feature is disabled.

Hi,

I don't use WhatsApp .


Please use the forums for all queries so other users with similar problems will benefit from the solutions and results.

[/off-topic]
Reply
#9

Ok, by now I can access the welcome controller and from there go to the view in the new views folder:

index.php in the /web1.com

$system_path = '/var/www/html/sistema/system';
$application_folder = '/var/www/html/sistema/application';   // <-- If I use only application it says don't have index.php
$view_folder = '/var/www/html/web1.com/views';

it works right, and can see the home ... but

when I try to go to web1.com/fotos it get apache 404 error
if I try to go to web1.com/index.php/fotos it get ci3 404 error

Where do I use the rewrite and how!?!?!?! for any web1.com/???

the controller fotos is "/var/www/html/sistema/application/controllers/Fotos.php" ...
Reply
#10

(This post was last modified: 03-02-2020, 09:31 AM by John_Betong.)

@Entai,

> Ok, by now I can access the welcome controller and from there go to the view in the new views folder:

Take a look at the flow chart below which is very helpful.

https://codeigniter.com/user_guide/overv...pflow.html

Once you understand the flow look at the appplication routes.php file and make changes to the routes and try:
1. adding parameters to the existing welcome_message page
2. getting the parameters to show on the welcome page
3. duplicate the welcome page in the same folder and add a route to find the new page.
4. try duplicating the Home class, rename and make a route to the new class and to a new page.

Upon reflection try the News Tutorial which is very good and covers the above points.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB