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

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

问题描述

我想创建一个网站,主要页面将从 CodeIgniter 提供.我将在/blog/子目录中使用 Wordpress 来托管博客.就是这样!我别无所求.只是为了确保:

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/调用 CI 控制器,其中 example.com/blog/some-post/由 Wordpress 处理.

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

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

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?

谢谢和问候,马斯农

推荐答案

我怀疑您可以使用站点根目录中的 .htaccess 文件使其工作.如果 blog 是安装 WordPress 的子目录的名称,并且您希望 example.com/blog 由 WordPress 处理,试试这个看看是否有帮助:

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]

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

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