Unwanted redirect when you don't use 'www' in URL
-
Hi. I’ve just added multisite functionality to my WP install (sub directories; WP is installed at /blogs/) and it went smoothly except now, whenever I type in example.com it redirects to http://www.example.com/blogs. No such problem when typing www.example.com. I have a non-WP index.php file in the site root which I want to keep as is.
htaccess:
RewriteEngine On RewriteBase /blogs/ 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]
and wp-config:
define('WP_ALLOW_MULTISITE', true); define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', false ); $base = '/blogs/'; define( 'DOMAIN_CURRENT_SITE', 'www.example.com' ); define( 'PATH_CURRENT_SITE', '/blogs/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 );
Please can somebody help resolving this. Thanks.
[ Please do not bump, it’s not permitted here. ]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Unwanted redirect when you don't use 'www' in URL’ is closed to new replies.