The ‘Access-Control-Allow-Origin’ -that is not equal to the supplied origin.-is therefore not allowed access.

阅读次数: 7,673

  • A+
所属分类:PHP 建站 运维

解决办法如下

<VirtualHost *>
    <Directory "/XXX">
		Options FollowSymLinks
		AllowOverride All
		Require all granted
		Order allow,deny 
        Allow from all
    </Directory>
    ServerAdmin webmaster@xxxx
    DocumentRoot "/xxx"
    ServerName www.xxx.com:80
    ServerAlias xxx.com
	#Header always set Access-Control-Allow-Origin "expr=%{req:origin}"
	Header always set Access-Control-Allow-Origin http://www.xxx.net

Header always set Access-Control-Allow-Headers "expr=%{req:Access-Control-Request-Headers}"

Header always set Access-Control-Allow-Methods "*"

Header always set Access-Control-Allow-Credentials "true"

Header always set Access-Control-Max-Age "3600"

RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ "/" [R=204,L]
    CustomLog logs/www.xxx.com-access.log comonvhost
    ErrorLog logs/www.xxx.com-error.log
</VirtualHost>

可以开启固定的,也可以允许所有的。但是好像也可以被模拟访问的!(能限制一般人就可以了)

案例 http://www.web888.in   《直播或视频站》

资源: http://www.ddd.place 《直播或视频资源》

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: