I developed a web application using Xampp and CodeIgniter. The best way to handle clean routing has been to set the VirtualHost to point on the folder containing the project in xampp/apache/conf/httpd.conf, then using routing routes in the route.php file, e.g.,
$route['page1'] = "Page1Controller/page1Function";
I use href or header like this using root as base folder:
href="/page1"
All that works very well on locally and I never use base_url()
or such functions.
Switching to production server, I obviously don't have any rights except for my personal folder and subfolders so when I execute it, root folder becomes root of all domain, not just my project folder.
I tried base_url()
but it doesn't work, pages aren't found, even when not using $route
.
Is there a way to handle this without refactoring all links in code or what is the way to do it with refactoring?
EDIT
Instead of using "/page1"
, I'm now using "./page1"
to access the location of the index.php folder. However, I'm still not able to access other pages neither with php, nor with html/js.