Wordpress 中的 WWW 链接重定向到主页
我最近将我工作的网站更新为 Wordpress 3.0。一些奇怪的事情开始发生,现在 www.已从 URL 中消失,如果您添加 www.到 URL(现有硬编码链接的很大一部分都有它),然后它会将您重定向到主页 URL。
有什么想法可能导致这种情况吗?
我的 .htaccess 看起来像是 WordPress 3.0 多用户的默认设置
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).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
我的 wp-config.php 中与多用户相关的设置是
/** Multi User */
define('WP_ALLOW_MULTISITE', true);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'xxxx.ca' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
我的域的 URL 设置只是 xxxx.ca,没有 www。在它的前面。
I've recently updated a website I work on to Wordpress 3.0. Something strange has started happening, where now the www. has dissapeared from the URLs, and if you add the www. to the URL (a good portion of the existing hardcoded links have it) then it redirects you to the home page URL.
Any ideas what could be causing this?
My .htaccess looks like the default for Wordpress 3.0 Multi-User
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).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
The settings in my wp-config.php related to the multi-user are
/** Multi User */
define('WP_ALLOW_MULTISITE', true);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'xxxx.ca' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
The URL settings for my domain is just the xxxx.ca, theres no www. infront of it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的 .htaccess 里有什么?像这样的吗?:
该重定向块会从所有 URL 中删除 www。
仪表板/设置/常规中的站点 URL 设置是什么?他们有www吗?您是否在 wp-config.php 中配置了站点 URL?
What's in your .htaccess? Anything like this?:
That redirect block strips the www from all URLs.
And what are the site URL settings in Dashboard/Settings/General? Do they have the www? And do you have site URLs configured in wp-config.php?