Welcome Guest, Not a member yet? Register   Sign In
Redirect issue on new local project
#1

Hi! I'm trying the last version of CI (CI4) but I'm getting any problems on the localhost installation.
The project is located in {XAMPP}/htdocs/ejemplo-ci
I've in App.php:

Code:
public $baseURL = 'http://localhost/ejemplo-ci/';
public $indexPage = 'index.php';

and the routes

Code:
$routes->get('/', 'Usuarios::index');
$routes->get('/registro', 'Usuarios::registro');

There isn't with the home page (references to index section con Usuarios controller) but
http://localhost/ejemplo-ci/registro send me to XAMPP Dashboard.
Can anybody help me?
Reply
#2

(This post was last modified: 01-07-2021, 05:17 AM by berendbotje91.)

For local development it is advised to use php built in web server. See http://codeigniter.com/user_guide/instal...nning.html

On a server everything is served from the public folder and changed using 'mod_rewrite' (on an apache webserver). This requires setting the documentroot in apache to '<location>/ejemplo-ci/public/' (where location is wherever ejemplo-ci is located).

My guess is that your XAMPP installation might not have mod-rewrite on or have the DocumentRoot set up.
Reply
#3

i've also written this for those on slackware Linux : https://docs.slackware.com/howtos:misc:a..._slackware . It mentions permission problems and being able to have several dev apps towards end
Reply
#4

(01-07-2021, 05:16 AM)berendbotje91 Wrote: For local development it is advised to use php built in web server. See http://codeigniter.com/user_guide/instal...nning.html

On a server everything is served from the public folder and changed using 'mod_rewrite' (on an apache webserver). This requires setting the documentroot in apache to '<location>/ejemplo-ci/public/' (where location is wherever ejemplo-ci is located).

My guess is that your XAMPP installation might not have mod-rewrite on or have the DocumentRoot set up.

Thank you! It worked, I found the guide very useful: now, I wonder what it will be like to put the project in production in an existing subfolder on a shared server.
Surely there is a guide for that ...
Reply
#5

PHP Code:
// change this
public $indexPage 'index.php';

// to this
public $indexPage ''

I had problems with xampp going to the dashboard before so now I just rename the
index.php file in the root with the htdocs folder.

But now I use VHOSTS
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#6

(01-08-2021, 04:21 AM)rcamino Wrote: Thank you! It worked, I found the guide very useful: now, I wonder what it will be like to put the project in production in an existing subfolder on a shared server.
Surely there is a guide for that ...

There might be a solution here: https://forum.codeigniter.com/thread-759...ed+hosting if you want to keep using shared hosting. However, I can't test it myself since I host on a VPS myself.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB