Cakephp里面的文件夹没有按预期工作(Cakephp inside a folder not working as expected)

编程入门 行业动态 更新时间:2024-10-28 08:18:38
Cakephp里面的文件夹没有按预期工作(Cakephp inside a folder not working as expected)

我在本地机器上安装了XAMPP。 我把蛋糕放在文件夹蛋糕中的htdocs中。 当我点击url localhost / cake /它寻找蛋糕控制器丢失。 为此,我试图改变文件夹中的.htaccess文件,如许多建议的那样

<IfModule mod_rewrite.c> RewriteEngine on RewriteBase /cake RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule>

但这没有帮助。 请指导我如何解决这个问题我必须为其他工作维护更多文件夹我不能把蛋糕放在root中。 谢谢

I have XAMPP installed om my local machine. I have put cake in htdocs in a folder cake. when i hit url localhost/cake/ it seeks cake controller missing. for this i have tried to change .htaccess file in the folder as suggested by many as

<IfModule mod_rewrite.c> RewriteEngine on RewriteBase /cake RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule>

But this is not helping. Please guide me how to solve this i have to maintain more folder for other works i can't put cake in root. Thanks

最满意答案

无需更改或更新文件夹中的任何.htaccess文件,只需在core.php对此行进行注释即可

//Configure::write('App.baseUrl', env('SCRIPT_NAME'));

这解决了这个问题。 保留所有.htaccess文件。 希望这也能帮助别人。

No need to change or update any .htaccess file in the folder just have to comment this line in core.php

//Configure::write('App.baseUrl', env('SCRIPT_NAME'));

and this solves the problem. Leave all the .htaccess files as it as. Hope this will help others too.

更多推荐

本文发布于:2023-07-24 00:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1239057.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件夹   工作   Cakephp   expected   working

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!