Wordpress里面Cakephp [英] Wordpress inside Cakephp

查看:231
本文介绍了Wordpress里面Cakephp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Cakephp的 / app / webroot / blog / 文件夹中安装了Wordpress,并将wordpress的固定链接设置更改为月份和名称(例如 http ://abc.com/blog/2013/02/sample-post/ )。

I have installed Wordpress inside Cakephp's /app/webroot/blog/ folder and changed the wordpress permalink settings to Month and name (eg. http://abc.com/blog/2013/02/sample-post/).

现在当我查看信息时获取丢失控制器(错误:BlogController找不到)。

Now when i am viewing a post i am getting Missing Controller(Error: BlogController could not be found).

我想更改cakephp路由,使 / blog / * 的任何东西都会指向webroot博客文件夹。

I want to change the cakephp routes so that anything with /blog/* will point to webroot blog folder.

任何人都可以帮助我吗?

Can anybody help me on this?

推荐答案

Wordpress的固定链接设置,它生成 .htaccess 文件,如果有必需的权限,否则我们必须创建它。

When we change the permalink settings of Wordpress, it generates a .htaccess file, if there is required permission else we have to create it.

在上述情况下, / blog /

In the above case there was no .htaccess file inside /blog/ folder. I created it with the following mod_rewrite rules as provided by Wordpress while changing permalink settings.

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /blog/
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /blog/index.php [L]
</IfModule>

之后,每件事都很好。

这篇关于Wordpress里面Cakephp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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