Welcome Guest, Not a member yet? Register   Sign In
Codeigniter in Subdirectory of Wordpress
#1

[eluser]Unknown[/eluser]
I have a wordpress site that needs a big application added to it. Thus, I want to install codeigniter in a subdirectory with access to wordpress header, footer, etc.

I know if I add 'require('../wp-blog-header.php');' to codeigniter's index.php I will have access to wordpress. However, I get a 404 error (from wordpress) when I want to access views in codeigniter.

Does anyone know of a way to make this work? A way to trick wordpress into thinking my subdirectory views are a page so I don't get the 404 error.

(note: the wordpress site is too big to convert to codeigniter)
#2

[eluser]pickupman[/eluser]
I am doing this the other way around but the same method still applies. First you will want to exclude the CI subfolder in your WP(root) .htaccess file. You can configure CI to use the WP database, you just probably want to make sure you namespace your tables. The way of using your WP theme is to use curl/file_get_contents of your home page, and use a regular expression for the body tag. Cache the result to a file (check out the link in my sig). You could create a library to do this, and use Phil's Cache library to save the page. Then replace the html content inside the body tags with your CI views.

As your front page changes (sidebar, header, etc), your CI will stay in sync. You can update your cache on a expiration that would be reasonable to match the freshness of the content/home page.
#3

[eluser]Unknown[/eluser]
thank you pickupman, that was very helpful




Theme © iAndrew 2016 - Forum software by © MyBB