htaccess配置 - 使用CodeIgniter - A3M库

时间:2010-12-21 00:14:46

标签: php .htaccess codeigniter oauth codeigniter-a3m

我下载了a3m,它与CI 1.7.2一起打包但我继续删除了运行所需的所有文件,并将它们放入我已有的安装中。在我的网站上访问a3m控制器后,我收到了: 消息:未定义的属性:CI :: $ session

所以我认为这是因为htaccess在a3m文件夹中查找a3m文件,这里是a3m htaccess:

RewriteEngine on 
RewriteRule ^$ /a3m/index.php [L] 
RewriteCond $1 !^(index\.php|css|img|js|scripts|system|uploads|robots\.txt|favicon\.ico) 
RewriteRule ^(.*)$ /a3m/index.php/$1 [L] 

我现有的用于mod重写的htaccess如下:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /beta/

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule> 

正如评论所显示的那样,我在一段时间后从一个网站上使用它,所以我怎么能把这两个结合起来我想我正在试着问,因为我对使用a3m很感兴趣。

谢谢你们。

1 个答案:

答案 0 :(得分:1)

看起来你没有加载会话库。

如果您加载了库,请检入system \ application \ config \ autoload.php: [42] $ autoload ['libraries'] = array('database','session');

您可以从控制器执行此操作: $这 - &GT;负载&GT;库( '会话');

http://codeigniter.com/user_guide/libraries/sessions.html