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 关于#极限编程#的问题,请各位专家解答!
  • ¥20 win11账户锁定时间设为0无法登录
  • ¥45 C#学生成绩管理系统
  • ¥15 VB.NET2022如何生成发布成exe文件
  • ¥30 matlab appdesigner私有函数嵌套整合
  • ¥15 vb6.0使用jmail接收smtp邮件并另存附件到D盘
  • ¥30 vb net 使用 sendMessage 如何输入鼠标坐标
  • ¥15 关于freesurfer使用freeview可视化的问题
  • ¥100 谁能在荣耀自带系统MagicOS版本下,隐藏手机桌面图标?
  • ¥15 求SC-LIWC词典!