1

我在我的网络服务器的 public_html 目录中运行了 WordPress(即我帐户上的主域指向该目录)。此文件夹中有用于其他网站的子目录(例如,“subdomain.com”网站的 /subdomain)。子目录中的一些网站是使用 FrontPage 编辑的。

我发现根目录中的 .htaccess 文件在为 WP 配置时会弄乱 FrontPage 权限并导致无法使用 FrontPage(FrontPage 从不提示进行身份验证并引发 404 错误)。从网络搜索中,我发现其他人遇到了这个问题(例如https://my.bluehost.com/cgi/help/375),但我没有成功实施其他人提出的修复。

以下是详细信息:

当此 .htaccess 文件位于根目录时,FrontPage 工作正常:

# -FrontPage-

AuthUserFile /home/user/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/user/public_html/_vti_pvt/service.grp


<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

AuthName myrootdomain.com
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

我想在这个根 .htaccess 文件中有 WP 部分,并尝试将以下 .htaccess 文件放在顶级 public_html 目录中:

#-FrontPage-

AuthUserFile /home/user/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/user/public_html/_vti_pvt/service.grp

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

AuthName myrootdomain.com
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

RewriteRule ^subdir-name/.*$ - [PT] 

ErrorDocument 404 /index.html
<files wp-config.php>
order allow,deny
deny from all
</files>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript application/xhtml+xml application/xml application/rss+xml application/atom_xml application/x-javascript application/x-httpd-php application/x-httpd-fastphp 
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
Options -Indexes
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

但是,当安装了上述带有 WP 组件的 .htaccess 文件时,它会破坏 FrontPage 身份验证。

我的“subdomainN”(由 FrontPage 编辑的域)的 _vti_bin 文件中的 .htaccess 文件如下所示:

# -FrontPage-

Options +FollowSymlinks

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName mydomain.com
AuthUserFile /home/user/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/user/public_html/_vti_pvt/service.grp

…并且子域 N 的 _vti_aut 和 _vti_adm 子目录中的 .htaccess 文件如下所示:

# -FrontPage-

Options +FollowSymlinks

<Limit GET POST>
order deny,allow
deny from all
allow from all
require group authors administrators
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthType Passthrough
AuthName myrootdomain.com
AuthUserFile /home/user/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/user/public_html/_vti_pvt/service.grp

关于我需要调整什么以使 FrontPage 身份验证工作和 .htaccess 文件中的 WP 组件的任何建议?

4

1 回答 1

0

在子目录中的所有 htaccess 文件中,添加:

RewriteEngine On

因此,不会应用来自文档根目录的重写规则。

于 2012-09-17T16:01:17.957 回答