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

如何从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?

我正在尝试将SabreDav实现为CakePHP(3.0)。 我把SabreDav包中的calendarserver.php文件放到了我的蛋糕webroot中。 现在我可以访问 http://localhost/myproject/calendarserver.php 。 此页面包含一个链接,该链接将我重定向到http :: //localhost/myproject/calendarserver.php/principals。 现在问题是当我点击链接Cake告诉我 PrincipalsController缺失 strong>时。 我不需要任何控制器,并且想要在没有蛋糕的calendarserver.php文件之后处理网址。 p>

我已经改变了我的.htaccess,就像 CakePHP .htaccess mod_rewrite配置以排除特定文件夹/网址 ,但同样的错误再次出现。 p>

我还尝试将saber文件夹复制一个高于webroot的steph(在项目文件夹中)并将我的.htacces修改为 p> \ n

RewriteCond%{REQUEST_URI}!^ /? (军刀)/(。*) strong> p>

有什么想法吗? p> div>

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

RewriteCond %{REQUEST_URI} ^/(sabre).* [NC]