可以利用apache的虚拟主机的配置设置:

2个域名一个是xxxxx.com ,一个是aaaaa.com

xxxxx.com配置只访问jpg文件,aaaaa.com可以访问所有文件

<VirtualHost *:80>
DocumentRoot "/phpstudy/file/thinkphp"
ServerName xxxxx.com
<Directory "/phpstudy/file/thinkphp">
order allow,deny
<filesmatch "\.(jpg)$">
Order allow,deny
allow from all
</filesmatch>
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "/phpstudy/file/thinkphp"
ServerName aaaaa.com
</VirtualHost>

配置好后重启apache生效

相关文章:

  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2021-04-29
  • 2022-12-23
  • 2021-10-14
  • 2022-02-13
  • 2021-10-02
猜你喜欢
  • 2021-05-25
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2021-10-07
相关资源
相似解决方案