强制使用SSL但排除文件夹

时间:2016-09-27 03:23:05

标签: .htaccess

我有一个网站,我已设法使用此.htaccess代码将http强制为https:

>>> np.apply_along_axis(nGauss, -1, x1, mu, cov)

问题是我需要在http中保留2个文件夹,例如文件夹1和folder2。

是否可以这样做?

由于

2 个答案:

答案 0 :(得分:0)

尝试这样,

with open("file.txt", "r") as f:
    searchlines = f.readlines()
# <-- unindent; we don't need this in the "with"
for i, line in enumerate(searchlines):
    # Aesthetics: use "-" * 78
    if "-" * 78 in line:
        for l in searchlines[i:i+6]:
            print l,
        # collect all the lines in output, not just the last one
        output = ''.join(searchlines[i:i+6])
        # if you expect more than one result, this is wrong
        break

# <-- unindent: we are done when the for loop is done
# Add an explicit encoding -- guessing here which one to use
msg = MIMEText(output, 'plain', 'utf-8')
msg['Subject'] = "Test email"
msg['From'] = from_address
msg['To'] = to_address

# no point in assigning body and not using it for anything

# Send the message via local SMTP server.
s = smtplib.SMTP('smtp.domain.com', '8025')
s.sendmail(from_address, to_address, msg.as_string())
s.quit()

答案 1 :(得分:0)

也许这不是我的问题的答案,但这是我需要的解决方案,我从automatic redirection to https?得到了这个。

由于