[英]How i can allow users to access download link from the specific web-page with HTACCESS in php
[英]How can I allow access to a specific folder with htaccess?
我有一个.htaccess文件,并且试图允许访问我们现有网站下的子网站(在文件夹内)。
我在.htaccess文件中使用了以下内容,但是当我尝试导航至想要允许的文件夹时,出现403错误。
Options +ExecCGI
AddType application/x-httpd-php .php .html
AddHandler x-httpd-php5 .php .html
<Directory /teen-writers/>
Satisfy Any
Allow from all
</Directory>
我也尝试过实现以下代码:
<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
但是,当上述代码实现时,还有:
Options +ExecCGI
AddType application/x-httpd-php .php .html
AddHandler x-httpd-php5 .php .html
我可以访问子站点/文件夹,但随后我的.html页面之一不再呈现为.php页面。
有什么建议么?
您不能在htaccess中使用Directory
指令。 尝试将其放在teen-writers
文件夹内的htaccess文件中。
Order allow,deny
Allow from all
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.