【问题标题】:Code Igniter 3 - Setting htaccess for multiple applicationCodeigniter 3 - 为多个应用程序设置 htaccess
【发布时间】:2016-04-12 02:39:21
【问题描述】:

我在设置 htaccess 时遇到问题.. 每当我调用我的网站时,它仅适用于 1 个应用程序,而另一个则不能。

这是我的文件夹结构:

-application
  -web
  -service
-aset
-assets
-system
-.htaccess
-index.php
-service.php

这是我的 htaccess 默认设置(适用于一个应用程序的所有版本):

RewriteEngine On

RewriteBase /mysite/

RewriteCond %{REQUEST_URI} ^system.*

RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

问题是,我想在 1 个项目中制作 2 个应用程序,所以我只需要制作应用程序/web 和应用程序/服务,并将应用程序 web 设置为默认应用程序。

我使用 Code Igniter 3.0.2、Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3

【问题讨论】:

  • 仅适用于 1 个应用程序?什么应用?我很困惑。
  • 我的意思是,它只能调用/mysite/web,但是服务应用不能。

标签: php .htaccess codeigniter-3


【解决方案1】:

我建议您将其他应用程序移到网络中。

-application
  -config
  -controller
  -model
  -view
  -service
    -application
      ...
    -system
    -.htaccess
    -index.php
-system
-.htaccess
-index.php

这就像在 codeigniter 中拥有一个 codeigniter。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-30
    • 1970-01-01
    • 2013-11-21
    • 1970-01-01
    • 2011-09-07
    • 1970-01-01
    相关资源
    最近更新 更多