Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 允许下载的访问权限_.htaccess_Whmcs - Fatal编程技术网

.htaccess 允许下载的访问权限

.htaccess 允许下载的访问权限,.htaccess,whmcs,.htaccess,Whmcs,使用WHMCS,如果使用HTTPS,则无法下载文件。例如,以下行不起作用: https://www.mysite.com/client/dl.php?type=a&id=239&i=0 然而,这是可行的: http://www.mysite.com/client/dl.php?type=a&id=239&i=0 因此,我的问题是,如何向以下内容添加重定向规则: RewriteCond %{HTTP_HOST} !svn.namhost.com RewriteC

使用WHMCS,如果使用HTTPS,则无法下载文件。例如,以下行不起作用:

https://www.mysite.com/client/dl.php?type=a&id=239&i=0
然而,这是可行的:

http://www.mysite.com/client/dl.php?type=a&id=239&i=0
因此,我的问题是,如何向以下内容添加重定向规则:

RewriteCond %{HTTP_HOST} !svn.namhost.com
RewriteCond %{HTTP_HOST}  \.
RewriteCond %{HTTP_HOST} !^www   [OR]
RewriteCond  %{HTTP_HOST} !\.com$ [OR]
RewriteCond %{HTTPS}     !=on
RewriteRule ^.*$ https://www.mysite.com/$0 [R=301,L]
因此,如果您访问:

https://www.mysite.com/client/dl.php?type=a&id=239&i=0
它将打开:

http://www.mysite.com/client/dl.php?type=a&id=239&i=0

应该有用。似乎你已经拥有的东西不应该干扰,因为它排除了www上的东西,但如果它干扰了,你可以添加

RewriteCond %{REQUEST_URI} !^/client/dl.php
到您的第一个块(在重写规则之前)

RewriteCond %{REQUEST_URI} !^/client/dl.php