Reputation: 42360
I have some legacy code that needs to be used in a new application. I would like to write the new application in CodeIgniter, but I still need to have some way of accessing the old code. what I would like to do is have an exception in the routing so that any url that has the format of example.com/old_stuff/*
goes to an old_stuff
folder, and acts as a regular, un-routed applications, while any other url such as example.com/new_stuff
would route to a new_stuff
controller, for example. So essentially what I want it to have URLs behave as they usually would in CodeIgniter, with the exception of any that start with one certain string.
What's the best way to accomplish this?
Upvotes: 0
Views: 739
Reputation: 62402
place codeigniter at your web root, and have your folder old_stuff
in the web root also.
then use .htaccess with these rules (assuming you have mod_rewrite)
RewriteEngine on
RewriteCond $1 !^(index\.php|images|old_stuff|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
then, a uri beginning with old_stuff
will just serve up the content bypassing codeigniter.
Upvotes: 2