Heim  >  Artikel  >  Backend-Entwicklung  >  phalcon 访问IndexController 中只能访问indexAction方法,访问不了testAction

phalcon 访问IndexController 中只能访问indexAction方法,访问不了testAction

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

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可以访问得到

求大神指点

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn