Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing CodeIgniter on root and WordPress in sub-directory

I want to create a website where the main pages will be served from CodeIgniter. I will use Wordpress in the /blog/ sub-directory to host the blog. Thats it! I want nothing else. Just to make sure that:

example.com/somepage/ calls a CI controller where as example.com/blog/some-post/ is handled by Wordpress.

I don't need any kind of integration or interaction between CI and WP.

Is it possible to install in that way? If not, any workarounds so that I can achieve the objectives?

Thanks and Regards, Masnun

like image 618
masnun Avatar asked Feb 03 '23 05:02

masnun


1 Answers

I suspect you could get this to work using an .htaccess file in the root directory of your site. If blog is the name of the subdirectory where WordPress is installed, and you want example.com/blog to be handled by WordPress, try this to see if it helps:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|blog)
RewriteRule ^(.*)$ /index.php/$1 [L]
like image 57
Rich Miller Avatar answered Feb 06 '23 14:02

Rich Miller