I have some problem with URL of Wordpress and Codeigniter integration, because I want to avoid data collisions between WP and CI site_url.
Here is my code on CI :
config.php
$config['base_url'] = 'http://www.mydomain.com';
my_helper.php
add_filter('site_url', 'ci_site_url', 1);
function ci_site_url()
{
include(APPPATH.'/config/config.php');
return $config['base_url'];
}
It works fine and show http://www.domain.com when I use
<?php
echo site_url();
?>
I want http://www.domain.com/index.php/admin/xxx when I use site_url('admin/xxx');
I have been looking for an answer here but I can't find it, so I would thank any help on this :-)
@raheel shan Where to add :
Installing wordpress and codeigniter is just a piece of cake. you need to do the following.
I assume you need wordpress inside Codeigniter so here is how you can do it.
in wordpress directory create a folder called myci
Now put codeigniter package in myci. Next you need to add this statment to
index.php
Now you need to extend
site_url
andbase_url
like thisHow to use :
Now you can access it like this. Hope it helps
Note folder name before index.php