我有一个codeigniter为基础的系统,在这两个应用程序,应用和网站的,它们共享一个单一的系统的文件夹。前者具有后端,后者具有前端。正因为如此,index.php文件默认的网站的,有一个单独的 app.php
进入后台。
I have a Codeigniter-based system with two apps in it, app and site, which share a single system folder. The former has the backend, latter has the front-end. Because of this, index.php defaults to site and there is a separate app.php
to access the backend.
的http://本地主机/子目录/
转到前端,同时访问后端我必须写的http://本地主机/子目录/ app.php
。
http://localhost/subdirectory/
goes to the frontend, while to access the backend I have to write http://localhost/subdirectory/app.php
.
我已经提到了用户指南对如何去除的的index.php 的东西,它可以在前端。比方说,的http://本地主机/子目录/页/约
成功地进入到的网站的文件夹中的与页的类的参数的有关的。
I have referred to the User Guide on how to remove the index.php thing, and it works on the frontend. Say, http://localhost/subdirectory/pages/about
successfully goes to the site folder's pages class with an argument of about.
问题是,当我尝试访问登录页面时,URI指向的http://localhost/subdirectory/app.php/auth/login
。进入的http://本地主机/子目录/应用/认证/登录
返回403禁止访问页面,该页面使用我presume是的的索引。 HTML 的文件夹上线 更新:发现,这是由于对的.htaccess present的应用的
The issue is when I try to access the login page, the URI points to http://localhost/subdirectory/app.php/auth/login
. Entering http://localhost/subdirectory/app/auth/login
returns the 403 Forbidden page, which I presume to be the index.html on the folder UPDATE: discovered that it's due to the .htaccess present on app.
我如何删除的 app.php 的一部分吗?
How can I remove the app.php part?
下面是我的应用程序结构:
Here's my application structure:
app
| - cache, config, controllers, views, and other related CI folders
site
| - cache, config, etc, like app
system
| - CI's system folder
app.php
index.php
.htaccess
和这里是我当前的.htaccess:
And here's my current .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(app)/(.*)$ app.php/$1 [NC,L]
RewriteRule ^(.*)$ index.php/$1 [NC,L]
这是行不通的。
任何帮助吗?谢谢!
更新:403禁止该节目最多的以从所有拒绝,不仅是因为 index.html的的,内容引起的.htaccess。我不知道这是否会有所帮助。
UPDATE: 403 Forbidden the shows up is caused by .htaccess with a content of "Deny from All", not only because of index.html. I don't know if this helps.
推荐答案
好了,想通了,通过重组我的架构。
Okay, figured it out through restructuring my architecture.
这是:
app
| - (application name for backend) folder
| -- models, config, controllers, etc. folders
| - index.php for backend
site
| - models, config, controllers, etc.
system
| - CI system folder
index.php for the frontend (which is on 'site')
原来看起来我们不需要用的.htaccess这个混乱的角力工作。这只是做自己看起来很愚蠢的。
Turns out it looks like we don't need messy arm-wrestling with .htaccess for this to work. This just made myself look really dumb.
谢谢大家的帮助!
相关推荐
最新文章