设置网站允许跨域访问

环境PHP+小皮面板(apache):

1、在httpd.conf,取消注释:LoadModule headers_module modules/mod_headers.so

2、修改需要被访问网站的vhosts.conf:

  

<Directory "*">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from XX.XX.XX.XX:XX      //设置允许访问的服务器IP和端口
      Require all granted
      DirectoryIndex index.php index.html error/index.html
            
  </Directory>

 

posted @ 2023-12-06 15:18  哆啦阿梦  阅读(136)  评论(0编辑  收藏  举报