我在根目录中有一个电子商务网站,并且想将我的博客移动到子目录。我成功地从另一个域转移到了这个域,但是当我尝试转到博客主页时,它会重定向到我的电子商务网站的主页。
电子商务网站 - http://www.heavytshirt.com
博客位置 -http://www.heavytshirt.com/blog
博客目录中的 .htaccess 文件如下所示:
RewriteEngine on
RewriteBase /
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
根目录中的 .htaccess 文件如下所示:
DirectoryIndex /mm5/merchant.mvc?Screen=SFNT
RewriteEngine On
RewriteRule ^mm5/admin.mvc? - [L]
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^product/([^/.]+).html$ /mm5/merchant.mvc?Screen=PROD&Product_code=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^category/([^/.]+).html$ /mm5/merchant.mvc?Screen=CTGY&Category_code=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^product/([^/]+)/([^/.]+).html$ /mm5/merchant.mvc?Screen=PROD&Category_code=$1&Product_code=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^([^/.]+).html$ /mm5/merchant.mvc?Screen=$1 [L]
### End - Inserted by Miva Merchant
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{http_host} ^heavytshirt.com [nc]
RewriteRule ^(.*)$ http://www.heavytshirt.com/$1 [r=301,nc]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
目前,我可以输入后续的子目录并找到一个帖子——比如:
http://www.heavytshirt.com/blog/category/summershirts/
http://www.heavytshirt.com/blog
当有人输入并且不影响主站点时,我该怎么做才能使博客主页出现www.heavytshirt.com