WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Multisite, 302 Redirects, and Htaccess (2 posts)

  1. pbowne
    Member
    Posted 1 year ago #

    Hi folks-

    We are having a consistent problem with Multisite and redirects. We are using the Sub-Folder version of Multisite.

    The primary (www) URL’s work fine but the non-www versions always redirect to the www-homepage.

    http://www.pointbeachlawyer.com/site1/ works fine but http://pointbeachlawyer.com/site1/ redirects to http://www.pointbeachlawyer.com

    We’ve tried multiple tests with different hosts and different amounts of content and the result is always the same!

    We suspect it has to do with the code required for the top of the .htaccess file (below). When we remove the code only the homepage works.

    Does anyone know how to fix this? While the site works with this bug we don’t feel it is viable as the penalty on usability is huge (for anyone without the www).

    Thanks!
    CJ

    The following is the htaccess code prescribed by WordPress when we were setting up the Multisite Network:

    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]
  2. A mix of www and non-www is always bad.

    You can try the .htaccess tricks here to force things one way: http://www.htaccessbasics.com/force-www-nonwww-domain/

Topic Closed

This topic has been closed to new replies.

About this Topic