htaccess允许两个子文件夹拒绝其他子文件夹

时间:2017-01-21 19:22:06

标签: wordpress apache .htaccess

我在名为wordpress的文件夹中安装了Wordpress

public_html
|
|wordpress
|
|webapp
|
|other folder
|junk folder

并将流量转发到htaccess文件中的该目录,如下所示。

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~webuser/wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~webuser/wordpress/index.php [L]
</IfModule>
# END WordPress

如果我想访问webapp文件夹,我会被重定向到wordpress。那是因为webapp文件夹中有文件index.php吗?

我想允许访问wordpress和webapp文件夹,但不允许访问public_html中的其他文件夹。我怎么能用htaccess做到这一点?

0 个答案:

没有答案