Welcome Guest, Not a member yet? Register   Sign In
index.php in the root folder?
#5

(01-12-2021, 08:22 PM)iRedds Wrote: Or maybe you can change the assembly as an option?
For example on OpenServer (https://ospanel.io/)?
There you can specify virtual hosts from the GUI.


Yes, this is not the answer you expected to hear. But I think this approach is more correct. Rather than trying to make the framework work through crutches.

Thanks for the advice. But as you can see, I am already aware of more correct approaches, yet given more correct approaches creates problem for me. It is why I decided to post this topic. May be you would explain why my approach is not a good (at least not acceptable ).

The problem for me is not the localhost. It is easy for me to setup a vhost in xampp. Very easy. I usually use simple shared web hostings for my projects and my clients. I can't use expensive servers to install custom softwares for small scale web sites.  Sometimes I have to use whatever my client already has. And it is most likely a php&mysql shared webhosting without offering much configuration.

Because of that I am looking something simple that I wouldn't care much what the hosting service provides me.



(01-12-2021, 09:24 PM)John_Betong Wrote: @kadirilkimen,

This may be of interest:

I have a localhost CI4 installation using Ubuntu with apache2:

I made the following changes:

1. renamed  /var/www/ci4-stict.tk/public_html/index.php to index-001.php
2. modified  /var/www/ci4-stict.tk/public_html/.htaccess -> RewriteRule ^(.*)$ index-001.php/$1 [L]
3. browsed to http://localhost/ci4-strict.tk/public_ht...ex-001.php

Delighted to say: splash page and all linked web-pages worked fine Smile

Edit:
I forgot to mention that I already had the following set:
Code:
// file: ./app/Config/App.php

public $indexPage = ''; //'index.php';

Is public_html the root folder for the website? CI 4 files doesn't have index.php in root folder. How did you get an index.php file in the root folder?

If public_html is not the root folder and it is actually "public" folder of the CI4, then you should probably did a different configuration to do it and it is the problem for me.

If you already have an index.php in root folder, why do you need to rename it like index-001.php? I didn't understand the point.

Angel  Yep. I am not so good developer. Yet I am exist and I believe that there are a lot of people like me that uses CI 3. Because it really makes things easier.

I am really curious if my solution has a significant drawbacks. Or any other solution would work with any simple shared webhosting without require server configuration.
Reply


Messages In This Thread
index.php in the root folder? - by kadirilkimen - 01-12-2021, 07:30 PM
RE: index.php in the root folder? - by iRedds - 01-12-2021, 08:22 PM
RE: index.php in the root folder? - by iRedds - 01-12-2021, 10:12 PM
RE: index.php in the root folder? - by kadirilkimen - 01-13-2021, 01:40 AM
RE: index.php in the root folder? - by iRedds - 01-13-2021, 06:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB