kenjis / codeigniter-composer-installer

Installs the offical CodeIgniter 3 with secure folder structure via Composer
MIT License
377 stars 118 forks source link

Setup on vhosts no working #47

Closed AdeSupriyadi closed 1 month ago

AdeSupriyadi commented 1 month ago

For some reason I can't upgrade my code from CI3 to CI4, I need restructure the folder with public folder. And it repo according to my needs.

setup on local environment

create virtualhost (ci3-public.devel) its working when we open on browser ci3-public.devel but when we open ci3-public.devel/welcome/index its can open, its show

Not Found The requested URL was not found on this server.

how to resolve it?

httpd-vhosts.php

<VirtualHost *:80>
    DocumentRoot "pathto/ci3-with-public/public/"
    ServerName ci3-public.devel
    <Directory "pathto/ci3-with-public/public/">
        AllowOverride All
    </Directory>
    ErrorLog "logs/ci3-public.devel-error.log"
    CustomLog "logs/ci3-public.devel-access.log" common
</VirtualHost>

hosts

127.0.0.1 ci3-public.devel
kenjis commented 1 month ago

The following error comes from Apache, not CI. So there is something wrong with your Apache configuration.

Not Found The requested URL was not found on this server.

  1. "pathto/ci3-with-public/public/" is not correct. Set the full path starting with /.
  2. you forgot to restart Apache.
AdeSupriyadi commented 1 month ago
  1. path "pathto" is alias of my path in this question, was full path of "C:/..bla-bla-bla../ci3-with-public/public/",
  2. I've restarted several times
kenjis commented 1 month ago

Is httpd-vhosts.php included?

Check error logs of Apache.

AdeSupriyadi commented 1 month ago

yes it is included.

No error in apache error.log that indicate about this vhosts (ci3-public.devel)

kenjis commented 1 month ago

Do you see the access log with code 404 in the access log file?

Try to access to ci3-public.devel/index.php/welcome/index.

AdeSupriyadi commented 1 month ago

ci3-public.devel/index.php/welcome/index yes now its works with index.php

how to remove index.php

kenjis commented 1 month ago

See https://codeigniter.com/userguide3/general/urls.html#removing-the-index-php-file

This repository is just an installer, and this issue is not an issue of this installer. Please go to the CI forum to get support. https://forum.codeigniter.com/

Also, CI3 is no longer maintained and I strongly recommend to upgrade to the latest v4.5.x or other frameworks. https://www.codeigniter.com/user_guide/installation/upgrade_4xx.html

AdeSupriyadi commented 1 month ago

OK, thanks, Its works