我一直在寻找,并还没有找到一篇文章,以帮助我。我很熟悉,当涉及到的htaccess的文件重写引擎,和我目前正在开发一个PHP MVC框架。
I've been searching and have yet to find an article to help me. I'm very unfamiliar when it comes to the rewrite engine of htaccess files, and am currently developing a php mvc framework.
基本上,从网络服务器的根目录下,我需要他们的控制器的所有页面请求/ url中的操作重定向到应用程序/ index.php的
Basically, from the root of the webserver, I need all page requests with their controllers / actions in the url to redirect to App/index.php
因此,例如site/Login/就直接到的index.php,和URI显然被解析用PHP来制定登录控制器通过后的数据。
So, for example site/Login/ would direct to the index.php, and the uri would obviously be parsed out with php to enact the login controller with passed post data.
推荐答案我觉得'平常'的方式是转发的不存在的文件和目录到控制器的所有请求:
I think the 'usual' way is to forward all requests for non-existent files and directories to your controller:
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ App/index.php [L]更多推荐
htaccess的URL路由的PHP MVC?
发布评论