cakephp 中的 .htaccess

发布于 2024-10-02 06:43:57 字数 454 浏览 0 评论 0原文

我不想在 cakephp 上使用 mod_rewrite,我想使用 cakePHP 的漂亮 URL。所以我删除了所有 .htaccess 文件

  1. /.htaccess
  2. /app/.htaccess
  3. /app/webroot/.htaccess

上的这一行

并取消注释 core.php配置::write('App.baseUrl', env('SCRIPT_NAME')) ;

不,问题是...如果我将控制器和操作放在 URL 中,它会显示 404 未找到错误。

http://www.mydomain.com/controller/action - 显示未找到

任何人都可以帮助我出这个。

I do not want to use mod_rewrite on cakephp and I want to use cakePHP's pretty URLs. So I have removed all the .htaccess files

  1. /.htaccess
  2. /app/.htaccess
  3. /app/webroot/.htaccess

and uncommentted this line on core.php

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

Noe the problem is...if I am putting controller and action in URL it is showing a 404 not found error.

http://www.mydomain.com/controller/action - showing not found

Can anyone help me out this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伏妖词 2024-10-09 06:43:57

尝试以下任一方法:

http://www.mydomain.com/index.php/controller/action

http://www.mydomain.com/index.php?controller/action

Try either:

http://www.mydomain.com/index.php/controller/action

http://www.mydomain.com/index.php?controller/action
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文