无法访问服务器上的子目录

时间:2014-12-17 15:31:29

标签: php wordpress apache .htaccess

我的服务器上安装了wordpress(它已经存在了)。现在我已经在root上创建了一个新目录,并希望在其上安装另一个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>

子目录名是英文。

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

1 个答案:

答案 0 :(得分: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>
相关问题