在根目录和WordPress的子目录中安装CodeIgniter [英] Installing CodeIgniter on root and WordPress in sub-directory

查看:161
本文介绍了在根目录和WordPress的子目录中安装CodeIgniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个网站,主要页面将从CodeIgniter提供。我将使用/ blog /子目录中的Wordpress托管博客。而已!我不想别的。只是为了确保:



example.com/somepage/调用CI控制器,其中example.com/blog/some-post/由Wordpress处理。 p>

我不需要任何类型的CI和WP之间的集成或交互。



那样?



感谢和问候,
Masnun

解决方案

我怀疑你可以使用.htaccess文件在你的网站的根目录下工作。如果blog是安装WordPress的子目录的名称,并且您希望example.com/blog由WordPress处理,请尝试此操作以查看它是否有帮助:

  RewriteEngine on 
RewriteCond $ 1!^(index\.php | images | robots\.txt | blog)
RewriteRule ^(。*)$ / index。 php / $ 1 [L]


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

解决方案

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]

这篇关于在根目录和WordPress的子目录中安装CodeIgniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆