从重定向到根URI prevent子页面页面、URI、prevent

2023-09-02 01:00:16 作者:范丞丞de女人

我在使用运行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/

下面(它的具体的东西的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.