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

WBOY
Release: 2016-10-22 00:14:12
Original
1305 people have browsed it

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

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

两个.htaccess

第一个

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

public目录下面的.htaccess中

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

访问路由 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>
Copy after login
Copy after login

public目录下面的.htaccess中

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

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

求大神指点

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!