Codeigniter with several webs |
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
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 (02-28-2020, 05:43 PM)John_Betong Wrote: I am not familiar with AWS Lightsale but do use an Apache2 VPS. Can you please put the example of the index.php and setup.php files?
(02-28-2020, 05:58 PM)John_Betong Wrote: @Entai I need CI 3, had all the websites and controllers on that version
@Entai.
Code: /* (02-28-2020, 08:06 PM)John_Betong Wrote: @Entai. 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
(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!?[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]
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" ...
@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. |
Welcome Guest, Not a member yet? Register Sign In |