0

我试图安装 Cjax 框架,但没有成功管理它。我已经阅读了这个http://cjax.sourceforge.net/docs/installing.php和这个https://github.com/EllisLab/CodeIgniter/wiki/Ajax-Framework-For-CodeIgniter

仍然无法成功管理安装。我的目录/文件结构如下所示:

/
/.htaccess

/application/
/application/ajax.php
/application/ajaxfw.php
/application/cache/
/application/cjax/
/application/config/
/application/controllers/
/application/controllers/AjaxController.php
/application/core/
/application/errors/
/application/helpers/
/application/hooks/
/application/language/
/application/libraries/
/application/logs/
/application/models/
/application/response/
/application/response/sample.php
/application/response/test.php
/application/views/
/application/test.php
/application/test2.php

/assets/
/assets/img,css,js -folders

/system/
/system/lots of more dirs

我也启用了,所以我不需要在我的 URL 中有 index.php。例如,我可以通过 http://example.com/registration 访问它而不是http://example.com/index.php/registration

.htaccess 看起来像这样:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|assets|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L] 
Hitting the following URLs:
http://mysite.com/ajax.php/test/test
http://mysite.com/ajax/test/test
http://mysite.com/ajax.php/test
http://mysite.com/ajax/test

我收到以下消息:

404页面不存在

未找到您所请求的页面。

我在做什么错以及如何修复安装?

4

2 回答 2

0

我建议您使用超级 htaccess:

    # Deny OR Allow Folder Indexes.
# Since we disable access to PHP files you 
# can leave this on without worries. 
# OR better yet, create a .htaccess file in
# the dir you want to allow browsing and
# set it to +Indexes
Options -Indexes

Options +FollowSymLinks

# Set the default file for indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    # mod_rewrite rules
    RewriteEngine on

    # The RewriteBase of the system (if you are using this sytem in a sub-folder).
    # RewriteBase /CodeIgniter_1.6.3/

    # This will make the site only accessible without the "www." 
    # (which will keep the subdomain-sensive config file happy)
    # If you want the site to be accessed WITH the "www." 
    # comment-out the following two lines.
    # RewriteCond %{HTTP_HOST} ^www\.site\.com$ [NC]
    # RewriteRule ^(.*)$ http://site.com/$1 [L,R=301]

    # If a controler can't be found - then issue a 404 error from PHP
    # Error messages (via the "error" plugin)
    # ErrorDocument 403 /index.php/403/
    # ErrorDocument 404 /index.php/404/
    # ErrorDocument 500 /index.php/500/

    # Deny any people (or bots) from the following sites: (to stop spam comments)
    # RewriteCond %{HTTP_REFERER} nienschanz\.ru [NC,OR]
    # RewriteCond %{HTTP_REFERER} porn\.com
    # RewriteRule .* - [F]
    # Note: if you are having trouble from a certain URL just 
    # add it above to forbide all visitors from that site.

    # You can also uncomment this if you know the IP:
    # Deny from 192.168.1.1

    # If the file is NOT the index.php file
    RewriteCond %{REQUEST_FILENAME} !index.php
    # Hide all PHP files so none can be accessed by HTTP
    RewriteRule (.*)\.php$ index.php/$1

    # If the file/dir is NOT real go to index
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]

</IfModule>

# If Mod_ewrite is NOT installed go to index.php
<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php
</IfModule> 
于 2013-05-24T08:43:22.640 回答
0

有一个新版本的 Cjax 5.9,可以直接插入 CodeIgniter ( https://github.com/ajaxboy/cjax )。

于 2016-08-16T16:51:11.600 回答