无法访问服务器上的子目录(Can't access sub directory on ser

2019-11-03 13:06发布

我有安装在它的根的WordPress服务器(它已经活)。 我现在已经创建了根一个新的目录,并要安装that.When我试图访问未发现子目录其显示页面错误一个WordPress。

My .htaccess file is as follows

# BEGIN s2Member GZIP exclusions

<IfModule rewrite_module>

 RewriteEngine On

RewriteBase /

RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+ [OR]

RewriteCond %{QUERY_STRING} (^|\?|&)no-gzip\=1

RewriteRule .* - [E=no-gzip:1]

</IfModule>

# END s2Member GZIP exclusions

# 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

试过以下,但没有奏效

ErrorDocument 401 default
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/english/(.*)$ [OR]
RewriteRule ^.*$ - [L]
</IfModule>

子目录的名称是英文。

任何人都可以帮助!!!! 提前致谢

Answer 1:

如果你有htdocs目录这个规则应该工作:

Options +FollowSymLinks

<IfModule rewrite_module>
    RewriteEngine On
    RewriteBase /
    # BEGIN s2Member GZIP exclusions
    RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+ [OR]
    RewriteCond %{QUERY_STRING} (^|\?|&)no-gzip\=1
    RewriteRule .* - [E=no-gzip:1]
    # END s2Member GZIP exclusions

    # BEGIN WordPress
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress
</IfModule>

而这在英语子文件夹:

ErrorDocument 401 default
<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /english/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>


文章来源: Can't access sub directory on server