为什么php .htacess将博客目录重定向到主页

时间:2015-06-27 12:32:43

标签: php wordpress apache .htaccess redirect

我正面临一个问题。我的网站是{
{3}}

我也有博客文件夹,我安装wordpress,网站其他网址工作正常,但当我点击http://www.wellnessvisit.com/

我的网页重定向到http://www.wellnessvisit.com/blog/

虽然我想重定向到http://www.wellnessvisit.com/

根.htaccess文件

RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php
RewriteRule ^index\.php$ / [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule doctor-(.*)\.htm$ doctor-details.php?doc_id=$1
RewriteRule hospital-(.*)\.htm$ hospital_detail.php?hosp_spec_id=$1
RewriteRule hotel-(.*)\.htm$ hotel_details.php?hotel_id=$1
RewriteRule destination-(.*)\.htm$ destination_details.php?dest_id=$1
RewriteRule news-(.*)\.htm$ news-details.php?news_id=$1
RewriteRule article-(.*)\.htm$ articles-details.php?article=$1
RewriteRule service-(.*)\.htm$ service-details.php?service_id=$1
RewriteRule user-register.php$ register.php 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [R=301,L]
#adds ".php" to a URL that isn't a directory or a file
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*)$ $1.php

Wordpress .htaccess文件

# 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

0 个答案:

没有答案