htaccess中的WordPress部分会杀死FrontPage权限

时间:2012-09-17 13:48:39

标签: wordpress .htaccess frontpage

我在我的网络服务器的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身份验证。

我的_vti_bin文件中的“subdomainN”(由FrontPage编辑的域)中的.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组件?

1 个答案:

答案 0 :(得分:0)

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

RewriteEngine On

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