Hey everyone! I’m just starting out with PHP and I’m building a website using CodeIgniter. I’m trying to set up a CMS for the backend, but I’m running into some issues.
I’ve got this CMS that comes with its own folder structure, including an .htaccess file and its own MVC setup. I thought it would be a good idea to keep things organized, so I moved all my frontend stuff into a folder called ‘frontend’ inside the application directory.
But now I can’t see any of my frontend pages when I try to load them. I keep getting an error saying ‘The configuration file does not exist.’
I’m pretty lost here. Can anyone walk me through how to properly set up a CodeIgniter project with separate frontend and backend sections? I’d really appreciate some step-by-step guidance. Thanks in advance!
hey there! have you tried using subdomains instead? like admin.yoursite.com for the cms and www.yoursite.com for the frontend? that might make things easier to manage. also, whats your experience with codeigniter so far? ive heard its pretty beginner-friendly, but im curious about your thoughts!
yo finn, sounds like a headache! have u considered using composer to manage ur project? it can help organize things better. also, check ur config files - they might be pointing to the wrong paths now. good luck with ur project, mate! lemme know if u need more help
Setting up a CodeIgniter project with separate frontend and backend can be tricky, but it’s definitely doable. Based on your description, it sounds like you’re encountering path issues. Here’s what I’d suggest:
Instead of placing your frontend in the application directory, create a separate folder at the root level for it. Your structure might look like:
/project_root
/backend (CodeIgniter core)
/frontend
index.php
.htaccess
Modify your .htaccess to route requests appropriately between frontend and backend. You’ll need to update CodeIgniter’s config files to reflect the new directory structure, particularly the base_url and index_page settings.
For the CMS integration, consider using CodeIgniter’s HMVC (Hierarchical Model-View-Controller) extension. This allows for modular development and can help separate your backend CMS from the frontend cleanly.
Remember to adjust your autoload paths and namespaces accordingly. It might take some trial and error, but this approach should give you a solid foundation for your project structure.