Home  >  Article  >  Backend Development  >  When phalcon accesses IndexController, it can only access the indexAction method, but cannot access testAction.

When phalcon accesses IndexController, it can only access the indexAction method, but cannot access testAction.

WBOY
WBOYOriginal
2016-10-22 00:14:121306browse

phalcon 访问IndexController 中只能访问indexAction方法,访问不了testAction
但是可以访问ArticleController里面的任意方法
看说是Apache 的rewrite问题

但是我的.htaccess文件都是按照文档里面的。

两个.htaccess

第一个

<code>RewriteEngine on
RewriteRule  ^$ public/    [L]
RewriteRule  ((?s).*) public/$1 [L]</code>

public目录下面的.htaccess中

<code>RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]</code>

访问路由 localhost/index/test访问不到,但是localhost/index.php?_url=/index/test可以访问得到

求大神指点

回复内容:

phalcon 访问IndexController 中只能访问indexAction方法,访问不了testAction
但是可以访问ArticleController里面的任意方法
看说是Apache 的rewrite问题

但是我的.htaccess文件都是按照文档里面的。

两个.htaccess

第一个

<code>RewriteEngine on
RewriteRule  ^$ public/    [L]
RewriteRule  ((?s).*) public/$1 [L]</code>

public目录下面的.htaccess中

<code>RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]</code>

访问路由 localhost/index/test访问不到,但是localhost/index.php?_url=/index/test可以访问得到

求大神指点

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn