Can't access sub directory on server

2019-09-08 15:37发布

问题:

I had a server with wordpress installed on its root(it's already live). Now i have created a new directory on root and want to install another wordpress on that.When i tried to access that sub directory its showing page not found error.

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

tried the following but didn't work

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

sub directory name is english.

Can anyone help!!!! Thanks in advance

回答1:

Should work if you have this rule in 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>

And this in english subfolder:

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>