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]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?