本文介绍了从重定向到根URI prevent子页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用运行Word,preSS 3.1.4网站一个微小但恼人的问题多站点。

导航到子页面的URI没有HTTP:// WWW,如abetterworldbydesign.com/2011-conference/导致重定向到根http://www.abetterworldbydesign.com。

的目的是为abetterworldbydesign.com/2011-conference/重定向到http://www.abetterworldbydesign.com/2011-conference/

下面(它的 .htaccess文件rel="nofollow">具体的东西的Word preSS多站点)。

 #BEGIN字preSS
RewriteEngine叙述上
的RewriteBase /
重写规则^指数\ .PHP $  -  [L]

#上传的文件
重写规则^([_ 0-9A-ZA-Z  - ] + /)?文件/(.+)WP-包括/ MS-files.php文件= $ 2 [L]

#添加斜线到/可湿性粉剂管理员
重写规则^([_ 0-9A-ZA-Z  - ] + /)?WP-ADMIN $ $ 1WP管理员/ [R = 301,L]

的RewriteCond%{} REQUEST_FILENAME -f [OR]
的RewriteCond%{} REQUEST_FILENAME -d
重写规则^  -  [L]
重写规则^ [_ 0-9A-ZA-Z  - ] + /(WP-(内容|管理|包括)*)$ 1 [L]
重写规则^ [_ 0-9A-ZA-Z  - ] + /(。* \ PHP)$ $ 1 [L]
重写规则。的index.php [L]
#结束字preSS
 

解决方案

尝试添加该

 的RewriteCond%{HTTP_HOST} ^ abetterworldbydesign.com
重写规则^(。*)$ http://www.abetterworldbydesign.com/$1 [R = 301,L]
 

在最高层,就在 RewriteEngine叙述在

I'm having a minor but annoying issue with a site running WordPress 3.1.4 Multisite.

Navigating to the URI of a subpage without the "http://www" such as "abetterworldbydesign.com/2011-conference/" results in a redirect to the root "http://www.abetterworldbydesign.com".

The intent is for "abetterworldbydesign.com/2011-conference/" to redirect to "http://www.abetterworldbydesign.com/2011-conference/".

.htaccess file below (it's specific stuff for WordPress Multisite).

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress
解决方案

Try adding this

RewriteCond %{HTTP_HOST} ^abetterworldbydesign.com
RewriteRule ^(.*)$ http://www.abetterworldbydesign.com/$1 [R=301,L]

at the very top, just after RewriteEngine On.

这篇关于从重定向到根URI prevent子页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 18:53