• Resolved abesanchez

    (@abesanchez)


    I am having an issue with redirects. When I put in bathplanet.com/reno it redirects me to bathplanet.com, only on the first attempt. I can go to bathplanet.com/reno after the main site loads, but it always redirects on the first attempt.

    This is what I have, WP told me to place this in the htaccess, the one from Network Admin–>Settings–>Network Setup. I just noticed also that this happens when trying for wp-amin, basically anything on the first attempt redirects me the main site. Any thoughts?

    # 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
Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    https://bathplanet.com/reno/ always redirects.

    https://www.bathplanet.com/reno/ never redirects.

    Was your site https://www.bathplanet.com before you turned on Multisite, or was it set up as https://bathplanet.com?

    In your wp-config, what’s define( 'DOMAIN_CURRENT_SITE', '???' ); set to? Do you have noblogredirect turned on, and if so, to what?

    Thread Starter abesanchez

    (@abesanchez)

    No bathplanet.com was not multisite before. My WHM lists it’s primary domain as bathplanet.com.

    define('WP_DEBUG', false);
    define('WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'www.bathplanet.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    That wasn’t what I meant ??

    I meant when you set up bathplanet as SINGLE site, did the Home and Site URLS include the WWW or not.

    define( 'DOMAIN_CURRENT_SITE', 'www.bathplanet.com' );

    That implies you did set it up with the www, which is why it doesn’t work without it. You may need to edit your .htaccess to forward all NON www calls to force www.

    Put something like this ABOVE the #Begin WordPress line:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www.your_domain.com$
    RewriteRule ^(.*)$ https://www.your_domain.com/$1 [R=301]

    Thread Starter abesanchez

    (@abesanchez)

    That seems to just break the site. However, this seems to work so far! Is there any thing not kosher about this?

    # Forcing www. infront of domain
    RewriteEngine On
    Options +FollowSymLinks
    RewriteCond %{HTTP_HOST} ^(bathplanet\.com)$ [NC]
    RewriteRule ^(.*)$ https://www.%1/$1 [R=301,L]
    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    That’s fine too (many servers are different) ?? You’d probably want this, though:

    # Forcing www. infront of domain
    RewriteEngine On
    Options +FollowSymLinks
    RewriteCond %{HTTP_HOST} ^(bathplanet\.com)$ [NC]
    RewriteRule ^(.*)$ https://www.bathplanet.com/$1 [R=301,L]

    Otherwise you’re reapeating the ‘$1’ twice and I’m not sure what that pulls down… of course, if it works, leave it be ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Multisite redirects to main page on first attempt’ is closed to new replies.