First off, I’m not a codeigniter developer, though I’ve had some exposure to it and MVC in general. I inherited a project where the companies old dev had taken down their codeigniter website and replaced it with a static one page html thing. They did this by (as far as I can tell) just renaming the index.php and putting an index.html in the root.
So… I moved all the codeigniter files to a subdirectory, and renamed the index.php file appropriately
Now the homepage appears, but all internal links are broken with an internal (500) server error.
I’ve done a couple things to no avail:
- modified the config.php base_url to include the subdir:
$config['base_url'] = "http://". $_SERVER['HTTP_HOST']."/subdir/"; - tried all the options for
$config['uri_protocol']
Anyone have any ideas? I really just need to recover the data from the site, which I can do manually just by looking in the database and some other stuff coded directly into the views – but I’d rather just get the old site running in the subdirectory.
Is
$config['index_page'] = '';?Is the server running Apache? If so, what about the
.htaccessrules? If so, you may need to add a RewriteBase rule, like so:We’re going off the assumption that the old dev used
anchor(),base_url(), and/orsite_url()correctly. If they hard-coded the links (which you shouldn’t do with CI), then you’d have to write.htaccessrules to rewrite them to the new sub directory or edit the controllers/views that might be generating such links.