Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在重写我的网址,如下所示:
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 文件中。