Home > Backend Development > PHP Tutorial > 网站某个目录中全部是html文件,如何控制用户必须登录才能访问这些静态文件?

网站某个目录中全部是html文件,如何控制用户必须登录才能访问这些静态文件?

WBOY
Release: 2016-06-23 14:23:08
Original
1161 people have browsed it

如题,感谢各位兄弟们的热情帮助,谢谢。


回复讨论(解决方案)

做一个控制文件,每次都访问此文件,将静态文件的名称当作参数传入以实现不同文件的访问控制。

方法很多,给两个常用的
1.修改apache禁止直接访问文件,在目录中添加.htaccess,设置密码
2.用单一入口的php文件,读入html文件再echo

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template