duanmei4149 2015-09-02 16:34
浏览 44
已采纳

如何从CakePHP路由中排除目录/文件?

I'm trying to implement SabreDav into CakePHP (3.0). I've put the calendarserver.php file from the SabreDav package into my cake webroot. Now I'm able to access http://localhost/myproject/calendarserver.php . This page contains a link, which redirects me to http:://localhost/myproject/calendarserver.php/principals . Now the problem is when I click the link Cake tells me that the PrincipalsController is missing. I don't need any controller and want to handle the url after my calendarserver.php file without cake.

I've changed my .htaccess like the solution of CakePHP .htaccess mod_rewrite configuration to exclude a particular folder/url , but the same error appears again.

I also tried to copy the sabre folder one steph higher than the webroot (in the project folder) and modify my .htacces to

RewriteCond %{REQUEST_URI} !^/? (sabre)/(.*)

Any ideas?

  • 写回答

1条回答 默认 最新

  • douyakan8924 2015-09-02 16:40
    关注

    Try using the following entry in your .htaccess file and see if it helps:

    RewriteCond %{REQUEST_URI} ^/(sabre).* [NC]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?