duanji8887 2013-08-06 16:37
浏览 218

Access-Control-Allow-Origin:500内部错误

So I am trying to have siteA do a jquery .load of some content on siteB. In doing this, im getting the Access-Control-Allow-Origin Error. So on siteB, I placed a .htaccess file that should allow siteA to be able to grab content from it. I am running into some trouble with this. I know the .htaccess file is being access because it is getting a 500 Internal Error when the page tries to load and i have content in the .htaccess file.

In the .htaccess file i have tried: Access-Control-Allow-Origin: * and: Access-Control-Allow-Origin: "*"

but both give the 500 error. I have also tried: Access-Control-Allow-Origin: *

This doesn't give the 500 error, so it must be coming back as false. I am not really sure what to do at this point. its possible i might be formatting the .htaccess file wrong or something, but i think it may have to do with mod_headers not being enabled.

In Logs: Invalid command 'Access-Control-Allow-Origin:', perhaps misspelled or defined by a module not included in the server configuration

Both sites are running through 10.8 Server.app, so its a little different from a normal Apache install which is making it a little difficult. Any help would be greatly appreciated! Thanks in advance!

  • 写回答

2条回答 默认 最新

  • doumei1772 2015-07-29 02:03
    关注

    I was just having the same issue, error 500 when I used:

    Header add Access-Control-Allow-Origin "*"
    

    It was due to a missing module , mod_headers , I just had to run on my server:

    sudo a2enmod headers
    

    as found here

    but i think you may need to edit manually .conf on OSX and uncomment the line:

    #LoadModule headers_module modules/mod_headers.so
    
    评论

报告相同问题?

悬赏问题

  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料