【问题标题】:Cross domain access not working跨域访问不起作用
【发布时间】:2014-05-29 15:48:53
【问题描述】:

我正在尝试向 xml 文件发出跨域请求。在.htaccess 我有

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>

apache2/sites-available/default

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

但我还是收到了

请求的资源上不存在“Access-Control-Allow-Origin”标头。因此,不允许访问 Origin '*'。

【问题讨论】:

    标签: .htaccess ubuntu apache2 crossdomain.xml


    【解决方案1】:

    编辑如下,应用你的路径:

    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    

    并确保您正在编辑正确的虚拟主机配置。例如。 apache2/sites-available/myVirtualWebsite.com

    【讨论】:

    猜你喜欢
    • 2018-12-05
    • 2013-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-28
    • 2014-09-28
    • 2013-03-05
    相关资源
    最近更新 更多