• Resolved -fra-

    (@fra-2)


    Hi everybody!
    Shame on me, I forgot to change https://www.domain.com to domain.com while enabling multisite.

    Everything is working “fine” except that if I try to reach domain.com without www it sends me directly to https://www.domain.com/signin.

    This is pretty annoying…what can I do? Can I manually remove the www now? If yes, where?

    Otherwise, can I avoid that behavior and just get to https://www.domain.com when I type domain.com?

    Thank you very much.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello -FrA-,

    You can just redirect the main domain to your subdomain(www).

    I suggest you copy your .htaccess before inserting this new rule.

    Note:Insert this new rule below “RewriteRule ^index\.php$ – [L]”

    #redirect main domain to subdomain, just replace the domain
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*)$ https://www.domain.com/$1 [R=301,L]

    Your .htaccess can be located at root folder of your wordpress install(this file is hidden by default).

    Let me know if this helps!

    Best Regards,
    Calvin

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Pssst Calvin. Use the CODE tags please ??

    Hello guys,

    @ipstenu

    Pssst Calvin. Use the CODE tags please ??

    Sorry, my bad. Will avoid it on the future replies. ??

    Best Regards,
    Calvin

    Thread Starter -fra-

    (@fra-2)

    Thank you Calvin, I’ve tried your suggestion, but anytime I try to reach https://domain.com I got redirected to https://www.domain.com/wp-signup.php?new=domain.com.

    My htaccess already looks like this:

    # -FrontPage-
    
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    
    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName domain.com
    AuthUserFile /home/domain/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/domain/public_html/_vti_pvt/service.grp
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*)$ https://www.domain.com/$1 [R=301,L]
    </IfModule>
    
    # END WordPress

    Any Idea on how to fix this?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The issue is your server is trying to serve both www and non-www versions of domain.com

    Put this at the TOP of your .htaccess

    # Force the "www."
    RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
    RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]

    REMOVE this:

    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*)$ https://www.domain.com/$1 [R=301,L]
    Thread Starter -fra-

    (@fra-2)

    Thank you! It works like a charm ??

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    FWIW, both my code and Calvin’s are the same. His said “If domain.com redirect to https://www.&#8221; Mind said “If NOT www, force https://WWW.&#8221;

    Some servers are weirder than others, though Calvin’s should have worked if at the top of the .htaccess.

    Remember! WordPress’ rules go on the bottom of your .htaccess file. Always.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Forgotten to remove www while enabling multisite’ is closed to new replies.