gpt4 book ai didi

apache - 使用 htaccess 将 'www.' 添加到 URL

转载 作者:行者123 更新时间:2023-12-01 15:42:39 25 4
gpt4 key购买 nike

我一直这样重写我的 URL:

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

这很好用,但是我有一个子目录是通过 apache/htaccess 密码保护的。当我导航到该目录时,我的浏览器出现 401 错误。有谁知道如何解决这个问题?

最佳答案

尝试放置:

ErrorDocument 401 "Unauthorized Access"
RewriteEngine off

... Authorisation lines

在包含授权指令的 .htaccess 文件中。

关于apache - 使用 htaccess 将 'www.' 添加到 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11734161/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com