我有一个由BlueHost托管的Wordpress网站。有没有办法在public_html下创建一个不会重定向到我的Wordpress网站的新子目录?我是否需要修改.htaccess文件?
更新:
这是当前的.htaccess文件:
# Use PHP5.4 as default
AddHandler application/x-httpd-php54 .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~user/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~user/index.php [L]
</IfModule>
# END WordPress
答案 0 :(得分:1)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
上述重写条件检查验证,当请求的资源不是可读目录或文件时,应该仅进行URL重写。因此,如果您的public_html
布局如此:
public_html/
wp-admin/
...
wp-content/
...
wp-includes/
...
my-sub-site/
index.php
...
.htaccess
index.php
...
然后您应该能够正常访问my-sub-site/index.php
,因为它存在且可读(如果不是,则验证rwx
访问权限。)