drwkqwa82140 2015-03-31 22:45 采纳率: 0%
浏览 34

如何禁止使用.htaccess访问我的某个文件夹? [求助]

I am running a DigitalOcean droplet with Ubuntu 14.04 x64.

In my /var/www/html directory, I have a include/ folder of files I include in PHP files but aren't standalone. I would like to prohibit direct URL access (return 403 errors) to these files, but still make it so that my standalone files can include them.

I have tried creating a .htaccess file inside the include/ folder containing:

<Files *>
    Order Deny,Allow
    Deny From All
    Allow From {my droplet IP address}
</Files>

This is not prohibiting access. Is this the right approach? Is my .htaccess file wrong? Is the IP address I am allowing from wrong?

Thanks.

  • 写回答

1条回答 默认 最新

  • dqj29136 2015-03-31 23:03
    关注

    have you tried Options -Indexes Create an .htaccess file with that content and place it inside the folder.

    评论

报告相同问题?

悬赏问题

  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题