UoaWDCC / ASPA-EnrollmentForm

6 stars 1 forks source link

[Aspa-015] Apache .htaccess URL rewrite to replace manually adding index.php #7

Closed lucas2005gao closed 4 years ago

lucas2005gao commented 4 years ago

Issue Controller methods cannot be found through the normal base_url/controller/method URL format. The temporary workaround was to add an "index.php" to activate the Codeigniter front controller before any controller method calls.

This pull request also covers the new project set up of adding another controller to inherit CI system controller class.

Solution Changing the .htaccess file to add a rewrite rule where if the file or directory is not found, redirect to an URL with "index.php" added. This saves all future codes from manually specifying index.php.

For the customizing core controller class, I have extracted another controller layer to inherit CI core system class to put customized reusable controller code in it.

Risk All existing codes that have manually added "index.php" would need a change, as it is suggested to remove the "index.php" part.

Reviewed by Raymond, Jiaru, Daniel