修改.htaccess以允许ajax访问一个文件
我有一个网站www.myurl.com 它的布局如下修改.htaccess以允许ajax访问一个文件,ajax,.htaccess,codeigniter,Ajax,.htaccess,Codeigniter,我有一个网站www.myurl.com 它的布局如下 /home/html/.htaccess /home/html/application /home/html/application/.htaccess /home/html/application/controllers/stats.php /home/html/.htaccess包含: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_F
/home/html/.htaccess
/home/html/application
/home/html/application/.htaccess
/home/html/application/controllers/stats.php
/home/html/.htaccess包含:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]
/home/html/application/.htaccess包含:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]
我不知道这是否重要,但该网站是由CodeIgniter提供动力的
这是我的问题,我正在进行以下Ajax调用:
$.ajax({
url: '<?php echo site_url('stats/get_stuff')?>',
type:'POST',
data: { parm1 : "parm1",
parm2 : "parm2",
parm3 : "parm3" },
dataType: 'json',
success: function(output_string){
}
<?php echo site_url('stats/get_stuff')?> returns:
http://www.myurl.com/stats/get_stuff
$.ajax({
url:“”,
类型:'POST',
数据:{parm1:“parm1”,
parm2:“parm2”,
parm3:“parm3”},
数据类型:“json”,
成功:函数(输出字符串){
}
返回:
http://www.myurl.com/stats/get_stuff
Ajax调用会产生以下错误:
401未经授权
我很确定我必须修改一个或两个.htaccess文件,但我不确定是哪一个,最重要的是我必须修改什么
有人能提供任何建议吗?在change.htaccess之前,尝试在
config.php
文件上设置$config['index\u page']='index.php'
;请参阅以获取答案