设置CakePHP的一个子目录;字preSS被安装在根 [英] Set up CakePHP in a subdirectory; Wordpress is installed in the root

查看:163
本文介绍了设置CakePHP的一个子目录;字preSS被安装在根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找2小时,但没有一个解决方案,似乎工作...这里是我的问题:

I have been searching for a solution for 2 hours but nothing seems to work... here is my problem:

我已经安装在根(VAR / WWW)字preSS。因此,通过将 http://www.geekderek.com ,我看到了我的话,preSS网站。

I have WordPress installed in the root (var/www). So by going to http://www.geekderek.com, I see my wordpress site.

我把CakePHP的一个子目录无功/网络/ CakePHP的。我希望能够看到转到我的CakePHP的应用程序:www.geekderek.com/cakephp

I put CakePHP in a subdirectory var/www/cakephp. I want to be able to see my CakePHP app by going to: www.geekderek.com/cakephp.

不过,目前这个网址只返回一个字preSS页说:内容没有发现。

However, currently this url just returns a Wordpress page saying "Content not found."

我相信这个问题可以通过在我的根目录下修改的.htaccess来解决。因此,这里是我的.htaccess: http://pastebin.com/sXJTRstB

I believe this problem can be solved by modifying .htaccess in my root directory. So here is my .htaccess: http://pastebin.com/sXJTRstB

正如你所看到的,我说这行到默认的WP .htaccess文件:

As you can see, I added this line to the default WP .htaccess file:

RewriteRule    ^cakephp(/(.*))?$ cakephp/app/webroot/$1    [QSA,L]

然而,出于某种原因,这似乎并没有工作。

However, for some reason this doesn't seem to work.

谁能告诉我什么是错的?太谢谢你了!

Could anyone please tell me what is wrong?? Thank you so much!

推荐答案

我有simmilar设置,我的蛋糕应用程序是在子目录下,我的根的.htaccess有这个重写规则:

I have simmilar setup, that my cake app is in subdirectory, my root .htaccess has this rewrite rule:

RewriteRule ^cakephp/(.*)$ /cakephp/$1 [L,QSA]

所有其余的是与常规的CakePHP安装程序来处理。

All the rest is handled with the regular cakephp setup.

我/cakephp/app/webroot/.htaccess:

my /cakephp/app/webroot/.htaccess:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

希望这个作品对你来说:)

hope this works for you too :)

这篇关于设置CakePHP的一个子目录;字preSS被安装在根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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