【发布时间】:2016-03-04 13:00:50
【问题描述】:
我有一个网站
- 前端:wordpress
- 后端:codeigniter
Codeigniter 实例保存在名为 backend 的文件夹中。
搭建后端的测试环境。
- 文件夹名称:团队
- codeigniter 安装在: abc 文件夹
所以路径将是:
publichtml/团队/abc
现在尝试登录时出现404 未找到错误。
谁能帮我看看脚本出了什么问题:
<script>
function sendData() {
var username = $("#username").val();
var userpass = $("#userpass").val();
$.post('https://example.com/team/abc/index.php/login/authenticateUserWeb',{ 'username': username, 'userpass': userpass }, function( data ) {
alert(data);
if(data == 'success'){
window.location = "https://example.com/team/abc/index.php/companyadmin/folders";
}else if(data == 'successuser'){
window.location = "https://example.com/team/abc/index.php/companyuser";
}else if(data == 'expired'){
window.location = 'https://example.com/team/abc/index.php/companyadmin/selectPacakge';
}else{
$("#user").html(data);
//alert(data);
}
});
}
现在当我尝试登录时,在控制台日志中发现以下错误:
发布https://example.com/team/abc/index.php/login/authenticateUserWeb
301 永久移动
jquery-1.10.2.js (line 6)
获取https://example.com/team/abc/login/authenticateUserWeb
404 未找到
https://example.com/team/abc/login/authenticateUserWeb"
网络错误:404 未找到
【问题讨论】:
-
不知道,但我注意到 index.php 已从 example.com/team/abc/index.php/login/authenticateUserWeb 中删除,并且 url 的更改类似于 GET example.com/team/abc/login/authenticateUserWeb
-
这是我的配置文件:$config['base_url'] = "example.com/team/abc"; $config['index_page'] = 'index.php';$config['allow_get_array'] = TRUE; $config['enable_query_strings'] = FALSE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; $config['directory_trigger'] = 'd';
-
我认为问题出在 HTACCESS
-
你是对的@markin Bhatt。你能建议我如何设置 .htaccess cond 来访问后端文件夹吗?
-
你好@MarmikBhatt 你能帮我解决这个问题吗?
标签: php ajax codeigniter